summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorPaul Slaughter <pslaughter@gitlab.com>2018-08-28 08:06:40 +0000
committerPhil Hughes <me@iamphill.com>2018-08-28 08:06:40 +0000
commit6bb08542579739ec5806a2dfe61c1f7c3c56a1f5 (patch)
treecd232638d5ac5f06073060b500403276e5d07058 /spec/javascripts
parenta1f1460ae5eafb44c25eeb2fae5102618fafe55f (diff)
downloadgitlab-ce-6bb08542579739ec5806a2dfe61c1f7c3c56a1f5.tar.gz
Resolve "It's impossible to commit twice to the same branch"
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/ide/stores/modules/commit/actions_spec.js28
1 files changed, 15 insertions, 13 deletions
diff --git a/spec/javascripts/ide/stores/modules/commit/actions_spec.js b/spec/javascripts/ide/stores/modules/commit/actions_spec.js
index 24a7d76f30b..06b8b452319 100644
--- a/spec/javascripts/ide/stores/modules/commit/actions_spec.js
+++ b/spec/javascripts/ide/stores/modules/commit/actions_spec.js
@@ -184,7 +184,7 @@ describe('IDE commit module actions', () => {
branch,
})
.then(() => {
- expect(f.lastCommit.message).toBe(data.message);
+ expect(f.lastCommitSha).toBe(data.id);
})
.then(done)
.catch(done.fail);
@@ -266,19 +266,21 @@ describe('IDE commit module actions', () => {
});
describe('success', () => {
+ const COMMIT_RESPONSE = {
+ id: '123456',
+ short_id: '123',
+ message: 'test message',
+ committed_date: 'date',
+ stats: {
+ additions: '1',
+ deletions: '2',
+ },
+ };
+
beforeEach(() => {
spyOn(service, 'commit').and.returnValue(
Promise.resolve({
- data: {
- id: '123456',
- short_id: '123',
- message: 'test message',
- committed_date: 'date',
- stats: {
- additions: '1',
- deletions: '2',
- },
- },
+ data: COMMIT_RESPONSE,
}),
);
});
@@ -352,8 +354,8 @@ describe('IDE commit module actions', () => {
store
.dispatch('commit/commitChanges')
.then(() => {
- expect(store.state.entries[store.state.openFiles[0].path].lastCommit.message).toBe(
- 'test message',
+ expect(store.state.entries[store.state.openFiles[0].path].lastCommitSha).toBe(
+ COMMIT_RESPONSE.id,
);
done();