Skip to content

Commit 29c4df5

Browse files
authored
test(material/select): attempt to reduce test flakes (#25646)
Tries to reduce the amount of flakes we've been seeing in the select tests by getting one of the slower tests to run faster.
1 parent adfd9a4 commit 29c4df5

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/material/legacy-select/select.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ describe('MatSelect', () => {
110110
],
111111
}).compileComponents();
112112

113-
inject([OverlayContainer], (oc: OverlayContainer) => {
114-
overlayContainerElement = oc.getContainerElement();
115-
})();
113+
overlayContainerElement = TestBed.inject(OverlayContainer).getContainerElement();
116114
}
117115

118116
describe('core', () => {
@@ -6002,7 +6000,7 @@ class SelectWithNgIfAndLabel {
60026000
`,
60036001
})
60046002
class MultiSelectWithLotsOfOptions {
6005-
items = new Array(1000).fill(0).map((_, i) => i);
6003+
items = new Array(100).fill(0).map((_, i) => i);
60066004
value: number[] = [];
60076005

60086006
checkAll() {

src/material/select/select.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ describe('MDC-based MatSelect', () => {
108108
],
109109
}).compileComponents();
110110

111-
inject([OverlayContainer], (oc: OverlayContainer) => {
112-
overlayContainerElement = oc.getContainerElement();
113-
})();
111+
overlayContainerElement = TestBed.inject(OverlayContainer).getContainerElement();
114112
}
115113

116114
describe('core', () => {
@@ -5021,7 +5019,7 @@ class SelectWithNgIfAndLabel {
50215019
`,
50225020
})
50235021
class MultiSelectWithLotsOfOptions {
5024-
items = new Array(1000).fill(0).map((_, i) => i);
5022+
items = new Array(100).fill(0).map((_, i) => i);
50255023
value: number[] = [];
50265024

50275025
checkAll() {

0 commit comments

Comments
 (0)