added specs

This commit is contained in:
Phil Hughes 2018-05-09 11:09:26 +01:00
parent cc0663140f
commit 96785e7713
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F
2 changed files with 20 additions and 0 deletions

View file

@ -28,6 +28,10 @@ describe('Multi-file editor library model', () => {
expect(model.originalModel).not.toBeNull();
expect(model.model).not.toBeNull();
expect(model.baseModel).not.toBeNull();
expect(model.originalModel.uri.path).toBe('original/path--path');
expect(model.model.uri.path).toBe('path--path');
expect(model.baseModel.uri.path).toBe('target/path--path');
});
it('creates model with head file to compare against', () => {

View file

@ -569,6 +569,22 @@ describe('IDE store file actions', () => {
.catch(done.fail);
});
it('returns false when already opened', done => {
store.state.openFiles.push({
...f,
active: true,
key: `pending-${f.key}`,
});
store
.dispatch('openPendingTab', { file: f, keyPrefix: 'pending' })
.then(added => {
expect(added).toBe(false);
})
.then(done)
.catch(done.fail);
});
it('pushes router URL when added', done => {
store.state.currentBranchId = 'master';