diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 12:08:49 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-13 12:08:49 +0000 |
commit | 1308dc5eb484ab0f8064989fc551ebdb4b1a7976 (patch) | |
tree | 614a93d9bf8df34ecfc25c02648329987fb21dde /spec/frontend/ide | |
parent | f0707f413ce49b5712fca236b950acbec029be1e (diff) | |
download | gitlab-ce-1308dc5eb484ab0f8064989fc551ebdb4b1a7976.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ide')
-rw-r--r-- | spec/frontend/ide/stores/actions/file_spec.js | 68 | ||||
-rw-r--r-- | spec/frontend/ide/stores/integration_spec.js | 15 |
2 files changed, 13 insertions, 70 deletions
diff --git a/spec/frontend/ide/stores/actions/file_spec.js b/spec/frontend/ide/stores/actions/file_spec.js index dd729651a61..6df963b0d55 100644 --- a/spec/frontend/ide/stores/actions/file_spec.js +++ b/spec/frontend/ide/stores/actions/file_spec.js @@ -534,27 +534,21 @@ describe('IDE store file actions', () => { .catch(done.fail); }); - it('adds a newline to the end of the file if it doesnt already exist', done => { - callAction('content') - .then(() => { - expect(tmpFile.content).toBe('content\n'); - - done(); + it('adds file into stagedFiles array', done => { + store + .dispatch('changeFileContent', { + path: tmpFile.path, + content: 'content', }) - .catch(done.fail); - }); - - it('adds file into changedFiles array', done => { - callAction() .then(() => { - expect(store.state.changedFiles.length).toBe(1); + expect(store.state.stagedFiles.length).toBe(1); done(); }) .catch(done.fail); }); - it('adds file not more than once into changedFiles array', done => { + it('adds file not more than once into stagedFiles array', done => { store .dispatch('changeFileContent', { path: tmpFile.path, @@ -567,7 +561,7 @@ describe('IDE store file actions', () => { }), ) .then(() => { - expect(store.state.changedFiles.length).toBe(1); + expect(store.state.stagedFiles.length).toBe(1); done(); }) @@ -594,52 +588,6 @@ describe('IDE store file actions', () => { .catch(done.fail); }); - describe('when `gon.feature.stageAllByDefault` is true', () => { - const originalGonFeatures = Object.assign({}, gon.features); - - beforeAll(() => { - gon.features = { stageAllByDefault: true }; - }); - - afterAll(() => { - gon.features = originalGonFeatures; - }); - - it('adds file into stagedFiles array', done => { - store - .dispatch('changeFileContent', { - path: tmpFile.path, - content: 'content', - }) - .then(() => { - expect(store.state.stagedFiles.length).toBe(1); - - done(); - }) - .catch(done.fail); - }); - - it('adds file not more than once into stagedFiles array', done => { - store - .dispatch('changeFileContent', { - path: tmpFile.path, - content: 'content', - }) - .then(() => - store.dispatch('changeFileContent', { - path: tmpFile.path, - content: 'content 123', - }), - ) - .then(() => { - expect(store.state.stagedFiles.length).toBe(1); - - done(); - }) - .catch(done.fail); - }); - }); - it('bursts unused seal', done => { store .dispatch('changeFileContent', { diff --git a/spec/frontend/ide/stores/integration_spec.js b/spec/frontend/ide/stores/integration_spec.js index 443de18f288..f95f036f572 100644 --- a/spec/frontend/ide/stores/integration_spec.js +++ b/spec/frontend/ide/stores/integration_spec.js @@ -61,19 +61,14 @@ describe('IDE store integration', () => { store.dispatch('createTempEntry', { name: TEST_PATH, type: 'blob' }); }); - it('has changed and staged', () => { - expect(store.state.changedFiles).toEqual([ - expect.objectContaining({ - path: TEST_PATH, - tempFile: true, - deleted: false, - }), - ]); - + it('is added to staged as modified', () => { expect(store.state.stagedFiles).toEqual([ expect.objectContaining({ path: TEST_PATH, - deleted: true, + deleted: false, + staged: true, + changed: true, + tempFile: false, }), ]); }); |