mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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
This commit is contained in:
committed by
Andrew Seguin
parent
8daa76020d
commit
c807ff3380
@@ -5,7 +5,8 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {LayoutModule, BreakpointObserver, BreakpointState} from './index';
|
||||
import {LayoutModule} from './layout-module';
|
||||
import {BreakpointObserver, BreakpointState} from './breakpoints-observer';
|
||||
import {MediaMatcher} from './media-matcher';
|
||||
import {async, TestBed, inject} from '@angular/core/testing';
|
||||
import {Injectable} from '@angular/core';
|
||||
@@ -77,11 +78,9 @@ describe('BreakpointObserver', () => {
|
||||
queryMatchState = state.matches;
|
||||
});
|
||||
|
||||
async(() => {
|
||||
expect(queryMatchState).toBeTruthy();
|
||||
mediaMatcher.setMatchesQuery(query, false);
|
||||
expect(queryMatchState).toBeFalsy();
|
||||
});
|
||||
expect(queryMatchState).toBeTruthy();
|
||||
mediaMatcher.setMatchesQuery(query, false);
|
||||
expect(queryMatchState).toBeFalsy();
|
||||
});
|
||||
|
||||
it('emits a true matches state when the query is matched', () => {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {NgModule} from '@angular/core';
|
||||
import {PlatformModule} from '@angular/cdk/platform';
|
||||
import {BreakpointObserver} from './breakpoints-observer';
|
||||
import {MediaMatcher} from './media-matcher';
|
||||
|
||||
@NgModule({
|
||||
providers: [BreakpointObserver, MediaMatcher],
|
||||
imports: [PlatformModule],
|
||||
})
|
||||
export class LayoutModule {}
|
||||
@@ -5,17 +5,8 @@
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {NgModule} from '@angular/core';
|
||||
import {PlatformModule} from '@angular/cdk/platform';
|
||||
import {BreakpointObserver} from './breakpoints-observer';
|
||||
import {MediaMatcher} from './media-matcher';
|
||||
|
||||
@NgModule({
|
||||
providers: [BreakpointObserver, MediaMatcher],
|
||||
imports: [PlatformModule],
|
||||
})
|
||||
export class LayoutModule {}
|
||||
|
||||
export {LayoutModule} from './layout-module';
|
||||
export {BreakpointObserver, BreakpointState} from './breakpoints-observer';
|
||||
export {Breakpoints} from './breakpoints';
|
||||
export {MediaMatcher} from './media-matcher';
|
||||
|
||||
Reference in New Issue
Block a user