Skip to content

Commit

Permalink
add an e2e-test to make sure the merge-conflict error is thrown when …
Browse files Browse the repository at this point in the history
…applicable (#604)
  • Loading branch information
davidfirst authored Jan 12, 2018
1 parent 5b342ec commit 277cbea
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions e2e/flows/merge.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { expect } from 'chai';
import Helper from '../e2e-helper';

describe('merge functionality', function () {
this.timeout(0);
const helper = new Helper();
after(() => {
helper.destroyEnv();
});
describe('re-exporting an existing version', () => {
let output;
before(() => {
helper.setNewLocalAndRemoteScopes();
helper.createComponentBarFoo();
helper.addComponentBarFoo();
helper.commitComponentBarFoo();
helper.exportAllComponents();

helper.reInitLocalScope();
helper.addRemoteScope();
helper.importComponent('bar/foo');
const scopeWithV1 = helper.cloneLocalScope();
helper.commitComponent('bar/foo', 'msg', '-f');
helper.exportAllComponents(); // v2 is exported

helper.getClonedLocalScope(scopeWithV1);
helper.commitComponent('bar/foo', 'msg', '-f');
try {
output = helper.exportAllComponents(); // v2 is exported again
} catch (e) {
output = e.message;
}
});
it('should throw merge-conflict error', () => {
expect(output).to.have.string('Merge conflict occurred when exporting the component');
});
});
});

0 comments on commit 277cbea

Please sign in to comment.