Commit 4f2f02bf authored by Phil Hughes's avatar Phil Hughes

fixed specs

parent 65871813
...@@ -13,6 +13,8 @@ describe('IDE commit form', () => { ...@@ -13,6 +13,8 @@ describe('IDE commit form', () => {
beforeEach(() => { beforeEach(() => {
spyOnProperty(window, 'innerHeight').and.returnValue(800); spyOnProperty(window, 'innerHeight').and.returnValue(800);
store.state.changedFiles.push('test');
vm = createComponentWithStore(Component, store).$mount(); vm = createComponentWithStore(Component, store).$mount();
}); });
...@@ -22,6 +24,10 @@ describe('IDE commit form', () => { ...@@ -22,6 +24,10 @@ describe('IDE commit form', () => {
resetStore(vm.$store); resetStore(vm.$store);
}); });
it('enables button when has changes', () => {
expect(vm.$el.querySelector('[disabled]')).toBe(null);
});
describe('compact', () => { describe('compact', () => {
it('renders commit button in compact mode', () => { it('renders commit button in compact mode', () => {
expect(vm.$el.querySelector('.btn-primary')).not.toBeNull(); expect(vm.$el.querySelector('.btn-primary')).not.toBeNull();
...@@ -33,7 +39,6 @@ describe('IDE commit form', () => { ...@@ -33,7 +39,6 @@ describe('IDE commit form', () => {
}); });
it('renders overview text', done => { it('renders overview text', done => {
vm.$store.state.changedFiles.push('test');
vm.$store.state.stagedFiles.push('test'); vm.$store.state.stagedFiles.push('test');
vm.$nextTick(() => { vm.$nextTick(() => {
......
...@@ -575,20 +575,6 @@ describe('IDE store file actions', () => { ...@@ -575,20 +575,6 @@ describe('IDE store file actions', () => {
.then(done) .then(done)
.catch(done.fail); .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', () => { describe('removePendingTab', () => {
......
...@@ -289,21 +289,6 @@ describe('IDE commit module actions', () => { ...@@ -289,21 +289,6 @@ describe('IDE commit module actions', () => {
.then(done) .then(done)
.catch(done.fail); .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', () => { describe('commitChanges', () => {
...@@ -391,21 +376,6 @@ describe('IDE commit module actions', () => { ...@@ -391,21 +376,6 @@ describe('IDE commit module actions', () => {
.catch(done.fail); .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 => { it('sets last Commit Msg', done => {
store store
.dispatch('commit/commitChanges') .dispatch('commit/commitChanges')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment