question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(MatCheckboxHarness): isChecked() returns false right after check()

See original GitHub issue

Reproduction

MatCheckboxHarness.isChecked() does not return true right after check() has been called on the harness:

const checkbox = await loader.getHarness(MatCheckboxHarness.with({selector: [formControlName="myFormControl"]})); 
await checkbox.check();
expect(await checkbox.isChecked()).toBeTruthy();

If the checkbox gets checked some other controls will be displayed. There is another test testing successfully for these controls after the call to MatCheckboxHarness.check(). Therefore I’m sure that check() is working okay but isChecked() does not worked as intended.

Expected Behavior

MatCheckboxHarness.isChecked() returns true right after check() has been called

Actual Behavior

MatCheckboxHarness.isChecked() returns false right after check() has been called

Environment

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
camuellercommented, May 25, 2020

Great - looks like you found the source of the problem πŸ˜ƒ

0reactions
angular-automatic-lock-bot[bot]commented, Jun 26, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Checkbox | Angular Material
Note that whenever checkbox is manually clicked, indeterminate is immediately set to false. @Input(). labelPosition: 'before' | 'after'.
Read more >
checkbox.isChecked() is always returning a false condition
It would seem that I want to do this check in onDestroy, which will execute after the user has pushed the OK button,...
Read more >
isChecked vs. isSelected for Android CheckBoxes and ...
But then things would not work right because even when the button was β€œchecked”, isSelected() returned false. It's not a compiler issue,Β ...
Read more >
CheckBox Tutorial With Example In Android Studio
This method returns a Boolean value either true or false, if a check box is checked then it returns true otherwise it returns...
Read more >
How to Check if CheckBox is Checked in Android?
Navigate to the app > res > layout > activity_main.xml and add the below code to that file. Below is the code for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found