The assertSelectedItems function needs to await 100ms currently to make sure the correct event is being tested.
The test should be updated to wait for the event necessary before proceeding with the function to test the event.
Test error, if applicable
FAIL src/components/dropdown/dropdown.e2e.ts (73.859 s)
● calcite-dropdown › renders no selected item when group is in none selection mode (and removes any selected state set in dom on load)
expect(received).toBe(expected) // Object.is equality
Expected: "item-2"
Received: "item-1"
83 | return (window as SelectionEventTestWindow).eventDetail.item.id;
84 | });
> 85 | expect(selectedItemId).toBe(mostRecentId);
| ^
86 | }
87 | expect(selectedItemIds).toHaveLength(expectedItemIds.length);
88 |
at assertSelectedItems (src/components/dropdown/dropdown.e2e.ts:85:30)
at runMicrotasks (<anonymous>)
at Object.<anonymous> (src/components/dropdown/dropdown.e2e.ts:373:5)
Test type
Unstable test
Which Component(s)
dropdown
Unstable Tests
The assertSelectedItems function needs to await 100ms currently to make sure the correct event is being tested.
The test should be updated to wait for the event necessary before proceeding with the function to test the event.
Test error, if applicable
FAIL src/components/dropdown/dropdown.e2e.ts (73.859 s) ● calcite-dropdown › renders no selected item when group is in none selection mode (and removes any selected state set in dom on load)
PR skipped, if applicable
https://github.com/Esri/calcite-components/pull/5715
Additional Info
Refactor test to remove the 100ms timeout and get the test stable.