diff options
Diffstat (limited to 'spec/javascripts/ide/stores/mutations')
-rw-r--r-- | spec/javascripts/ide/stores/mutations/file_spec.js | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/spec/javascripts/ide/stores/mutations/file_spec.js b/spec/javascripts/ide/stores/mutations/file_spec.js index 064e66cef64..7c46bf55318 100644 --- a/spec/javascripts/ide/stores/mutations/file_spec.js +++ b/spec/javascripts/ide/stores/mutations/file_spec.js @@ -356,16 +356,16 @@ describe('IDE store file mutations', () => { }); describe('STAGE_CHANGE', () => { - it('adds file into stagedFiles array', () => { + beforeEach(() => { mutations.STAGE_CHANGE(localState, localFile.path); + }); + it('adds file into stagedFiles array', () => { expect(localState.stagedFiles.length).toBe(1); expect(localState.stagedFiles[0]).toEqual(localFile); }); it('updates stagedFile if it is already staged', () => { - mutations.STAGE_CHANGE(localState, localFile.path); - localFile.raw = 'testing 123'; mutations.STAGE_CHANGE(localState, localFile.path); @@ -373,19 +373,6 @@ describe('IDE store file mutations', () => { expect(localState.stagedFiles.length).toBe(1); expect(localState.stagedFiles[0].raw).toEqual('testing 123'); }); - - it('adds already-staged file to `replacedFiles`', () => { - localFile.raw = 'already-staged'; - - mutations.STAGE_CHANGE(localState, localFile.path); - - localFile.raw = 'testing 123'; - - mutations.STAGE_CHANGE(localState, localFile.path); - - expect(localState.replacedFiles.length).toBe(1); - expect(localState.replacedFiles[0].raw).toEqual('already-staged'); - }); }); describe('UNSTAGE_CHANGE', () => { |