diff options
Diffstat (limited to 'spec/frontend/ide')
-rw-r--r-- | spec/frontend/ide/stores/mutations/file_spec.js | 29 | ||||
-rw-r--r-- | spec/frontend/ide/stores/mutations_spec.js | 20 |
2 files changed, 39 insertions, 10 deletions
diff --git a/spec/frontend/ide/stores/mutations/file_spec.js b/spec/frontend/ide/stores/mutations/file_spec.js index cd308ee9991..9b96b910fcb 100644 --- a/spec/frontend/ide/stores/mutations/file_spec.js +++ b/spec/frontend/ide/stores/mutations/file_spec.js @@ -356,6 +356,14 @@ describe('IDE store file mutations', () => { expect(localState.changedFiles.length).toBe(1); }); + + it('bursts unused seal', () => { + expect(localState.unusedSeal).toBe(true); + + mutations.ADD_FILE_TO_CHANGED(localState, localFile.path); + + expect(localState.unusedSeal).toBe(false); + }); }); describe('REMOVE_FILE_FROM_CHANGED', () => { @@ -366,6 +374,14 @@ describe('IDE store file mutations', () => { expect(localState.changedFiles.length).toBe(0); }); + + it('bursts unused seal', () => { + expect(localState.unusedSeal).toBe(true); + + mutations.REMOVE_FILE_FROM_CHANGED(localState, localFile.path); + + expect(localState.unusedSeal).toBe(false); + }); }); describe.each` @@ -517,6 +533,19 @@ describe('IDE store file mutations', () => { }, ); + describe('STAGE_CHANGE', () => { + it('bursts unused seal', () => { + expect(localState.unusedSeal).toBe(true); + + mutations.STAGE_CHANGE(localState, { + path: localFile.path, + diffInfo: localStore.getters.getDiffInfo(localFile.path), + }); + + expect(localState.unusedSeal).toBe(false); + }); + }); + describe('TOGGLE_FILE_CHANGED', () => { it('updates file changed status', () => { mutations.TOGGLE_FILE_CHANGED(localState, { diff --git a/spec/frontend/ide/stores/mutations_spec.js b/spec/frontend/ide/stores/mutations_spec.js index eb89c92914a..9fe75d596fb 100644 --- a/spec/frontend/ide/stores/mutations_spec.js +++ b/spec/frontend/ide/stores/mutations_spec.js @@ -196,16 +196,6 @@ describe('Multi-file store mutations', () => { }); }); - describe('BURST_UNUSED_SEAL', () => { - it('updates unusedSeal', () => { - expect(localState.unusedSeal).toBe(true); - - mutations.BURST_UNUSED_SEAL(localState); - - expect(localState.unusedSeal).toBe(false); - }); - }); - describe('SET_ERROR_MESSAGE', () => { it('updates error message', () => { mutations.SET_ERROR_MESSAGE(localState, 'error'); @@ -297,6 +287,16 @@ describe('Multi-file store mutations', () => { expect(localState.changedFiles).toEqual([]); }); + + it('bursts unused seal', () => { + localState.entries.test = file('test'); + + expect(localState.unusedSeal).toBe(true); + + mutations.DELETE_ENTRY(localState, 'test'); + + expect(localState.unusedSeal).toBe(false); + }); }); describe('UPDATE_FILE_AFTER_COMMIT', () => { |