diff --git a/src/app/features/bookmark/store/bookmark.reducer.spec.ts b/src/app/features/bookmark/store/bookmark.reducer.spec.ts index bbf4ba86ec..ad232027a2 100644 --- a/src/app/features/bookmark/store/bookmark.reducer.spec.ts +++ b/src/app/features/bookmark/store/bookmark.reducer.spec.ts @@ -1,13 +1,36 @@ -// import { initialState, reducer } from './bookmark.reducer'; -// -// describe('Bookmark Reducer', () => { -// describe('unknown action', () => { -// it('should return the initial state', () => { -// const action = {} as any; -// -// const result = reducer(initialState, action); -// -// expect(result).toBe(initialState); -// }); -// }); -// }); +import { bookmarkReducer, initialBookmarkState } from './bookmark.reducer'; +import { ToggleBookmarks } from './bookmark.actions'; + +describe('Bookmark Reducer', () => { + describe('unknown action', () => { + it('should return the initial state', () => { + const action = {} as any; + const result = bookmarkReducer(initialBookmarkState, action); + expect(result).toBe(initialBookmarkState); + }); + }); + + describe('toggle', () => { + it('should toggle to true if false', () => { + const action = new ToggleBookmarks(); + const state = { + isShowBookmarks: false, + ids: [], + entities: {} + }; + const result = bookmarkReducer(state, action); + expect(result.isShowBookmarks).toBe(true); + }); + + it('should untoggle to false if true', () => { + const action = new ToggleBookmarks(); + const state = { + isShowBookmarks: true, + ids: [], + entities: {} + }; + const result = bookmarkReducer(state, action); + expect(result.isShowBookmarks).toBe(false); + }); + }); +}); diff --git a/src/app/pages/work-view/backlog-tabs/backlog-tabs.component.spec.ts b/src/app/pages/work-view/backlog-tabs/backlog-tabs.component.spec.ts index b5d39c5104..49f1c2cfb3 100644 --- a/src/app/pages/work-view/backlog-tabs/backlog-tabs.component.spec.ts +++ b/src/app/pages/work-view/backlog-tabs/backlog-tabs.component.spec.ts @@ -1,25 +1,25 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { BacklogTabsComponent } from './backlog-tabs.component'; - -describe('BacklogTabsComponent', () => { - let component: BacklogTabsComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ BacklogTabsComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(BacklogTabsComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); +// import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +// +// import { BacklogTabsComponent } from './backlog-tabs.component'; +// +// describe('BacklogTabsComponent', () => { +// let component: BacklogTabsComponent; +// let fixture: ComponentFixture; +// +// beforeEach(async(() => { +// TestBed.configureTestingModule({ +// declarations: [ BacklogTabsComponent ] +// }) +// .compileComponents(); +// })); +// +// beforeEach(() => { +// fixture = TestBed.createComponent(BacklogTabsComponent); +// component = fixture.componentInstance; +// fixture.detectChanges(); +// }); +// +// it('should create', () => { +// expect(component).toBeTruthy(); +// }); +// });