-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NAS-131092 / 25.04 / Remove ngx-layout (#10648)
- Loading branch information
Showing
11 changed files
with
115 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { BreakpointObserver } from '@angular/cdk/layout'; | ||
import { Router } from '@angular/router'; | ||
import { | ||
createServiceFactory, | ||
mockProvider, | ||
SpectatorService, | ||
} from '@ngneat/spectator/jest'; | ||
import { provideMockActions } from '@ngrx/effects/testing'; | ||
import { provideMockStore } from '@ngrx/store/testing'; | ||
import { BehaviorSubject, of } from 'rxjs'; | ||
import { SidenavService } from 'app/services/sidenav.service'; | ||
import { selectPreferences } from 'app/store/preferences/preferences.selectors'; | ||
|
||
describe('SidenavService', () => { | ||
let spectator: SpectatorService<SidenavService>; | ||
const breakpointObserve$ = new BehaviorSubject({ matches: true }); | ||
const createService = createServiceFactory({ | ||
service: SidenavService, | ||
providers: [ | ||
mockProvider(Router, { | ||
events: of(), | ||
}), | ||
mockProvider(BreakpointObserver, { | ||
observe: jest.fn(() => breakpointObserve$), | ||
}), | ||
provideMockActions(of()), | ||
provideMockStore({ | ||
selectors: [ | ||
{ | ||
selector: selectPreferences, | ||
value: { | ||
sidenavStatus: { | ||
isCollapsed: true, | ||
}, | ||
}, | ||
}, | ||
], | ||
}), | ||
], | ||
}); | ||
|
||
beforeEach(() => { | ||
spectator = createService(); | ||
}); | ||
|
||
describe('listenForScreenSizeChanges', () => { | ||
it('listens for screen size changes and sets isMobile accordingly', () => { | ||
expect(spectator.service.isMobile()).toBe(true); | ||
|
||
breakpointObserve$.next({ matches: false }); | ||
expect(spectator.service.isMobile()).toBe(false); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters