From 3276ee444aa13a658bc8674461a0632d4cf0b7ed Mon Sep 17 00:00:00 2001 From: David First Date: Fri, 12 Jan 2018 15:02:54 -0500 Subject: [PATCH] add an e2e-test to make sure the merge-conflict error is thrown when applicable --- e2e/flows/merge.e2e.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 e2e/flows/merge.e2e.js diff --git a/e2e/flows/merge.e2e.js b/e2e/flows/merge.e2e.js new file mode 100644 index 000000000000..afb239d49ebf --- /dev/null +++ b/e2e/flows/merge.e2e.js @@ -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'); + }); + }); +});