Open
Description
Reproduction
- Clone repo: https://github.com/DmitryEfimenko/mat-autocomplete-harness-issue
- install deps
Steps to reproduce:
- In the console:
npm run test
- Make sure NOT to bring the opened Chrome window showing Jasmine tests into the visibility
If it opens in front, quickly click on some other window to bring the Chrome window to the background - Observe: test succeeds
- make a small change in test (change spec name) to trigger test re-run
- Observe: test still succeeds
- Bring the Chrome window showing Jasmine tests into the visibility
- Observe: test fail
Recording:
https://user-images.githubusercontent.com/2098175/113951456-76f5b680-97c8-11eb-9893-5cca66ac1a8c.mp4
Expected Behavior
Unit test should pass.
Specifically, autocompleteHarness.getOptions()
should return 3 options instead of 0
Actual Behavior
Unit test only passes while the Jasmine Chrome window is in the background
Environment
- Angular: 11.2.8
- CDK/Material: 11.2.7
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Tested on:
- Windows
- Mac
Notes
I have created a StackBlitz repository with basically the same code, but can't reproduce the issue there:
https://stackblitz.com/edit/harness-issue-2m77t5?file=src/app/autocomplete-harness-example.spec.ts