Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug with testing MatSelect using getHarness and getOptions #19075

Closed
metalllus opened this issue Apr 14, 2020 · 2 comments · Fixed by #19112 or lingounet/testage#29
Closed

bug with testing MatSelect using getHarness and getOptions #19075

metalllus opened this issue Apr 14, 2020 · 2 comments · Fixed by #19112 or lingounet/testage#29
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@metalllus
Copy link

Reproduction

Steps to reproduce:
When I have multiple matSelect elements on page, I use getHarness() method with an appropriate selector to get the required harness. When I use the getValueText() method on the grabbed harness, I get the expected value. However if I then use the getOptions method on this harness, I get the options from the very first matSelect element on the page and not the options from the matSelect harness I got using the selector.

Expected Behavior

Get the correct options from the MatSelectHarness grabbed using a selector.

Actual Behavior

I get the options from the very first matSelect element on page and not the options from the matSelect harness I got using the selector.

Environment

  • Angular: 9
  • CDK/Material: 9
  • Browser(s): latest Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10
@metalllus metalllus added the needs triage This issue needs to be triaged by the team label Apr 14, 2020
@crisbeto
Copy link
Member

Can you post what your test and test component look like?

@crisbeto crisbeto self-assigned this Apr 19, 2020
@crisbeto crisbeto added has pr P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Apr 19, 2020
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 19, 2020
… page at the same time

Fixes the test harness always retrieving the options for the first select when there are multiple selects on the page.

Fixes angular#19075.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 19, 2020
… page at the same time

Fixes the test harness always retrieving the options for the first select when there are multiple selects on the page.

Fixes angular#19075.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 19, 2020
… page at the same time

Fixes the test harness always retrieving the options for the first select when there are multiple selects on the page.

Fixes angular#19075.
jelbourn pushed a commit that referenced this issue Apr 23, 2020
… page at the same time (#19112)

Fixes the test harness always retrieving the options for the first select when there are multiple selects on the page.

Fixes #19075.
jelbourn pushed a commit that referenced this issue Apr 23, 2020
… page at the same time (#19112)

Fixes the test harness always retrieving the options for the first select when there are multiple selects on the page.

Fixes #19075.
soro-google pushed a commit to soro-google/components that referenced this issue Apr 24, 2020
… page at the same time (angular#19112)

Fixes the test harness always retrieving the options for the first select when there are multiple selects on the page.

Fixes angular#19075.
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
2 participants