Skip to content

Commit fe77542

Browse files
authored
test(cdk/layout): fix test failure (#23598)
Fixes a test failure that seems to have snuck into master because of #23571.
1 parent 505c0d1 commit fe77542

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/cdk/layout/media-matcher.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ describe('MediaMatcher', () => {
2121
expect(mediaMatcher.matchMedia('(max-width: 1px)').matches).toBeFalsy();
2222
});
2323

24-
it('should add CSS rules for provided queries when the platform is webkit',
24+
it('should add CSS rules for provided queries when the platform is webkit or blink',
2525
inject([Platform], (platform: Platform) => {
26-
const randomWidth = `${Math.random()}px`;
26+
const width = '123456px';
2727

28-
expect(getStyleTagByString(randomWidth)).toBeFalsy();
29-
mediaMatcher.matchMedia(`(width: ${randomWidth})`);
28+
expect(getStyleTagByString(width)).toBeFalsy();
29+
mediaMatcher.matchMedia(`(width: ${width})`);
3030

31-
if (platform.WEBKIT) {
32-
expect(getStyleTagByString(randomWidth)).toBeTruthy();
31+
if (platform.WEBKIT || platform.BLINK) {
32+
expect(getStyleTagByString(width)).toBeTruthy();
3333
} else {
34-
expect(getStyleTagByString(randomWidth)).toBeFalsy();
34+
expect(getStyleTagByString(width)).toBeFalsy();
3535
}
3636

3737
function getStyleTagByString(str: string): HTMLStyleElement | undefined {

0 commit comments

Comments
 (0)