Skip to content

Commit c807ff3

Browse files
CaerusKaruandrewseguin
authored andcommitted
test(layout): remove async wrapper to prevent hiding test failure (#10305)
* With the async call around the checks in the layout test, the results of the subscribe are never actually checked
1 parent 8daa760 commit c807ff3

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

src/cdk/layout/breakpoints-observer.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import {LayoutModule, BreakpointObserver, BreakpointState} from './index';
8+
import {LayoutModule} from './layout-module';
9+
import {BreakpointObserver, BreakpointState} from './breakpoints-observer';
910
import {MediaMatcher} from './media-matcher';
1011
import {async, TestBed, inject} from '@angular/core/testing';
1112
import {Injectable} from '@angular/core';
@@ -77,11 +78,9 @@ describe('BreakpointObserver', () => {
7778
queryMatchState = state.matches;
7879
});
7980

80-
async(() => {
81-
expect(queryMatchState).toBeTruthy();
82-
mediaMatcher.setMatchesQuery(query, false);
83-
expect(queryMatchState).toBeFalsy();
84-
});
81+
expect(queryMatchState).toBeTruthy();
82+
mediaMatcher.setMatchesQuery(query, false);
83+
expect(queryMatchState).toBeFalsy();
8584
});
8685

8786
it('emits a true matches state when the query is matched', () => {

src/cdk/layout/layout-module.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
import {NgModule} from '@angular/core';
9+
import {PlatformModule} from '@angular/cdk/platform';
10+
import {BreakpointObserver} from './breakpoints-observer';
11+
import {MediaMatcher} from './media-matcher';
12+
13+
@NgModule({
14+
providers: [BreakpointObserver, MediaMatcher],
15+
imports: [PlatformModule],
16+
})
17+
export class LayoutModule {}

src/cdk/layout/public-api.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,8 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import {NgModule} from '@angular/core';
9-
import {PlatformModule} from '@angular/cdk/platform';
10-
import {BreakpointObserver} from './breakpoints-observer';
11-
import {MediaMatcher} from './media-matcher';
12-
13-
@NgModule({
14-
providers: [BreakpointObserver, MediaMatcher],
15-
imports: [PlatformModule],
16-
})
17-
export class LayoutModule {}
188

9+
export {LayoutModule} from './layout-module';
1910
export {BreakpointObserver, BreakpointState} from './breakpoints-observer';
2011
export {Breakpoints} from './breakpoints';
2112
export {MediaMatcher} from './media-matcher';

0 commit comments

Comments
 (0)