-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(vuex): change default-state object to a factory function (#183)
closes #182
- Loading branch information
1 parent
da9422f
commit 66d31fb
Showing
21 changed files
with
73 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import { AppGetters } from './getters'; | ||
import { AppDefaultState } from './state'; | ||
import { AppGetters } from './getters'; | ||
import { AppDefaultState, IAppState } from './state'; | ||
|
||
describe('AppGetters', () => { | ||
let testState: IAppState; | ||
|
||
beforeEach(() => { | ||
testState = AppDefaultState(); | ||
}); | ||
|
||
test('it should get the locale', () => { | ||
expect(AppGetters.getLocale(AppDefaultState)).toBe(null); | ||
expect(AppGetters.getLocale(testState)).toBe(null); | ||
}); | ||
|
||
test('it should get the cookie consent version', () => { | ||
expect(AppGetters.cookieConsentVersion(AppDefaultState)).toBe(''); | ||
expect(AppGetters.cookieConsentVersion(testState)).toBe(''); | ||
}); | ||
|
||
}); |
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 |
---|---|---|
@@ -1,18 +1,23 @@ | ||
import { CounterGetters } from './getters'; | ||
import { CounterDefaultState } from './state'; | ||
import { CounterGetters } from './getters'; | ||
import { CounterDefaultState, ICounterState } from './state'; | ||
|
||
describe('CounterGetters', () => { | ||
let testState: ICounterState; | ||
|
||
beforeEach(() => { | ||
testState = CounterDefaultState(); | ||
}); | ||
|
||
test('it should get the count', () => { | ||
expect(CounterGetters.count(CounterDefaultState)).toBe(0); | ||
expect(CounterGetters.count(testState)).toBe(0); | ||
}); | ||
|
||
test('it should get increment pending', () => { | ||
expect(CounterGetters.incrementPending(CounterDefaultState)).toBe(false); | ||
expect(CounterGetters.incrementPending(testState)).toBe(false); | ||
}); | ||
|
||
test('it should get decrement pending', () => { | ||
expect(CounterGetters.decrementPending(CounterDefaultState)).toBe(false); | ||
expect(CounterGetters.decrementPending(testState)).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
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 |
---|---|---|
@@ -1,18 +1,23 @@ | ||
import { {{ properCase moduleName }}Getters } from './getters'; | ||
import { {{ properCase moduleName }}DefaultState } from './state'; | ||
import { {{ properCase moduleName }}DefaultState, I{{ properCase moduleName }}State } from './state'; | ||
|
||
describe('{{ properCase moduleName }}Getters', () => { | ||
let testState: I{{ properCase moduleName }}State; | ||
|
||
beforeEach(() => { | ||
testState = {{ properCase moduleName }}DefaultState(); | ||
}); | ||
|
||
test('it should get the count', () => { | ||
expect({{ properCase moduleName }}Getters.count({{ properCase moduleName }}DefaultState)).toBe(0); | ||
expect({{ properCase moduleName }}Getters.count(testState)).toBe(0); | ||
}); | ||
|
||
test('it should get increment pending', () => { | ||
expect({{ properCase moduleName }}Getters.incrementPending({{ properCase moduleName }}DefaultState)).toBe(false); | ||
expect({{ properCase moduleName }}Getters.incrementPending(testState)).toBe(false); | ||
}); | ||
|
||
test('it should get decrement pending', () => { | ||
expect({{ properCase moduleName }}Getters.decrementPending({{ properCase moduleName }}DefaultState)).toBe(false); | ||
expect({{ properCase moduleName }}Getters.decrementPending(testState)).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
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