-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
80 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,5 @@ Thumbs.db | |
package-lock.json | ||
|
||
# application files | ||
*version.ts | ||
*version.ts | ||
junit.xml |
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,28 @@ | ||
import { async, TestBed } from '@angular/core/testing'; | ||
import { NgxsModule, Store } from '@ngxs/store'; | ||
|
||
import { OpenSidenav, CloseSidenav } from './layout.actions'; | ||
import { LayoutState } from './layout.state'; | ||
|
||
describe('Layout', () => { | ||
let store: Store; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ imports: [NgxsModule.forRoot([LayoutState])] }).compileComponents(); | ||
store = TestBed.get(Store); | ||
})); | ||
|
||
it('it opens side navigation panel', () => { | ||
store.dispatch(new OpenSidenav()); | ||
store.selectOnce(state => state.layout.showSidenav).subscribe(showSidenav => { | ||
expect(showSidenav).toBe(true); | ||
}); | ||
}); | ||
|
||
it('it closes side navigation panel', () => { | ||
store.dispatch(new CloseSidenav()); | ||
store.selectOnce(state => state.layout.showSidenav).subscribe(showSidenav => { | ||
expect(showSidenav).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { async, TestBed } from '@angular/core/testing'; | ||
import { NgxsModule, Store } from '@ngxs/store'; | ||
|
||
import { SetDistance, SetLocation, SetRating, SetReviews } from './filter.actions'; | ||
import { FilterState } from './filter.state'; | ||
|
||
describe('Filter', () => { | ||
let store: Store; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ imports: [NgxsModule.forRoot([FilterState])] }).compileComponents(); | ||
store = TestBed.get(Store); | ||
})); | ||
|
||
it('it should set location', () => { | ||
store.dispatch(new SetLocation({ latitude: 10, longitude: 10 })); | ||
store.selectOnce(state => state.filter.location).subscribe(location => { | ||
expect(location.latitude).toBe(10); | ||
expect(location.longitude).toBe(10); | ||
}); | ||
}); | ||
|
||
it('it should set distance', () => { | ||
store.dispatch(new SetDistance(100)); | ||
store.selectOnce(state => state.filter.distance).subscribe(distance => { | ||
expect(distance).toBe(100); | ||
}); | ||
}); | ||
|
||
it('it should set rating', () => { | ||
store.dispatch(new SetRating(5)); | ||
store.selectOnce(state => state.filter.rating).subscribe(rating => { | ||
expect(rating).toBe(5); | ||
}); | ||
}); | ||
|
||
it('it should set reviews', () => { | ||
store.dispatch(new SetReviews(50)); | ||
store.selectOnce(state => state.filter.reviews).subscribe(reviews => { | ||
expect(reviews).toBe(50); | ||
}); | ||
}); | ||
}); |
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