-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged in feature/SHIBUI-729 (pull request #171)
SHIBUI-729 Implemented filter re-ordering Approved-by: Shibui Jenkins <shibui.jenkins@gmail.com> Approved-by: Ryan Mathis <rmathis@unicon.net>
- Loading branch information
Showing
24 changed files
with
613 additions
and
142 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { reducer, initialState as snapshot, getContention } from './contention.reducer'; | ||
import { ContentionActionTypes, ShowContentionAction, ResolveContentionAction, CancelContentionAction } from '../action/contention.action'; | ||
|
||
describe('Contention Reducer', () => { | ||
|
||
const contention = { | ||
base: {}, | ||
ours: {}, | ||
theirs: {}, | ||
|
||
rejectionObject: {}, | ||
resolutionObject: {}, | ||
|
||
ourChanges: {}, | ||
theirChanges: {}, | ||
|
||
handlers: { | ||
resolve: (value: {}) => ({}), | ||
reject: (value: {}) => ({}) | ||
} | ||
}; | ||
|
||
const populated = { ...snapshot, contention: { ...contention } }; | ||
|
||
const resolution = { value: contention.ours, handlers: contention.handlers }; | ||
|
||
describe('undefined action', () => { | ||
it('should return the default state', () => { | ||
const result = reducer(snapshot, {} as any); | ||
|
||
expect(result).toEqual(snapshot); | ||
}); | ||
}); | ||
|
||
describe(`${ContentionActionTypes.SHOW_CONTENTION}`, () => { | ||
it('should reset to initial state', () => { | ||
expect(reducer(snapshot, new ShowContentionAction(contention))).toEqual(populated); | ||
}); | ||
}); | ||
|
||
describe(`${ContentionActionTypes.RESOLVE_CONTENTION}`, () => { | ||
it('should reset to initial state', () => { | ||
expect(reducer(snapshot, new ResolveContentionAction(resolution))).toEqual(snapshot); | ||
}); | ||
}); | ||
|
||
describe(`${ContentionActionTypes.CANCEL_CONTENTION}`, () => { | ||
it('should reset to initial state', () => { | ||
expect(reducer(snapshot, new CancelContentionAction(resolution))).toEqual(snapshot); | ||
}); | ||
}); | ||
|
||
describe(`getContention method`, () => { | ||
it('should return the contention object from the state', () => { | ||
expect(getContention(snapshot)).toBe(snapshot.contention); | ||
expect(getContention(populated)).toEqual(contention); | ||
}); | ||
}); | ||
}); |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.