-
Notifications
You must be signed in to change notification settings - Fork 938
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add an e2e-test to make sure the merge-conflict error is thrown when …
…applicable (#604)
- Loading branch information
1 parent
5b342ec
commit 277cbea
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
}); | ||
}); |