diff options
author | Phil Hughes <me@iamphill.com> | 2018-05-02 14:59:14 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-05-02 14:59:14 +0300 |
commit | 4f2f02bfe867544cb4a73e90a2dd499f3ecfc653 (patch) | |
tree | 57a4e05bbf276491bfab85dba61cfddf61ff7a61 /spec | |
parent | 65871813e6280b7601c0752bf07d03cf6f5638b8 (diff) |
fixed specs
Diffstat (limited to 'spec')
3 files changed, 6 insertions, 45 deletions
diff --git a/spec/javascripts/ide/components/commit_sidebar/form_spec.js b/spec/javascripts/ide/components/commit_sidebar/form_spec.js index c387b96795b..ce7c134bc97 100644 --- a/spec/javascripts/ide/components/commit_sidebar/form_spec.js +++ b/spec/javascripts/ide/components/commit_sidebar/form_spec.js @@ -13,6 +13,8 @@ describe('IDE commit form', () => { beforeEach(() => { spyOnProperty(window, 'innerHeight').and.returnValue(800); + store.state.changedFiles.push('test'); + vm = createComponentWithStore(Component, store).$mount(); }); @@ -22,6 +24,10 @@ describe('IDE commit form', () => { resetStore(vm.$store); }); + it('enables button when has changes', () => { + expect(vm.$el.querySelector('[disabled]')).toBe(null); + }); + describe('compact', () => { it('renders commit button in compact mode', () => { expect(vm.$el.querySelector('.btn-primary')).not.toBeNull(); @@ -33,7 +39,6 @@ describe('IDE commit form', () => { }); it('renders overview text', done => { - vm.$store.state.changedFiles.push('test'); vm.$store.state.stagedFiles.push('test'); vm.$nextTick(() => { diff --git a/spec/javascripts/ide/stores/actions/file_spec.js b/spec/javascripts/ide/stores/actions/file_spec.js index ce5c525bed7..07b6bb11b0b 100644 --- a/spec/javascripts/ide/stores/actions/file_spec.js +++ b/spec/javascripts/ide/stores/actions/file_spec.js @@ -575,20 +575,6 @@ describe('IDE store file actions', () => { .then(done) .catch(done.fail); }); - - it('returns false when passed in file is active & viewer is diff', done => { - f.active = true; - store.state.openFiles.push(f); - store.state.viewer = 'diff'; - - store - .dispatch('openPendingTab', { file: f, keyPrefix: 'pending' }) - .then(added => { - expect(added).toBe(false); - }) - .then(done) - .catch(done.fail); - }); }); describe('removePendingTab', () => { diff --git a/spec/javascripts/ide/stores/modules/commit/actions_spec.js b/spec/javascripts/ide/stores/modules/commit/actions_spec.js index b2b4b85ca42..a2869ff378b 100644 --- a/spec/javascripts/ide/stores/modules/commit/actions_spec.js +++ b/spec/javascripts/ide/stores/modules/commit/actions_spec.js @@ -289,21 +289,6 @@ describe('IDE commit module actions', () => { .then(done) .catch(done.fail); }); - - it('pushes route to new branch if commitAction is new branch', done => { - store.state.commit.commitAction = consts.COMMIT_TO_NEW_BRANCH; - - store - .dispatch('commit/updateFilesAfterCommit', { - data, - branch, - }) - .then(() => { - expect(router.push).toHaveBeenCalledWith(`/project/abcproject/blob/master/${f.path}`); - }) - .then(done) - .catch(done.fail); - }); }); describe('commitChanges', () => { @@ -391,21 +376,6 @@ describe('IDE commit module actions', () => { .catch(done.fail); }); - it('pushes router to new route', done => { - store - .dispatch('commit/commitChanges') - .then(() => { - expect(router.push).toHaveBeenCalledWith( - `/project/${store.state.currentProjectId}/blob/${ - store.getters['commit/newBranchName'] - }/changed`, - ); - - done(); - }) - .catch(done.fail); - }); - it('sets last Commit Msg', done => { store .dispatch('commit/commitChanges') |