Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-05-09 13:09:26 +0300
committerPhil Hughes <me@iamphill.com>2018-05-09 13:09:26 +0300
commit96785e7713de958de8c7786545aea66caf1557f1 (patch)
treefaac74357a486fdb41bdb93ac7a642d10e04d891 /spec/javascripts
parentcc0663140fb2d54f7f9962c9c27c82e2eb5116df (diff)
added specs
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/ide/lib/common/model_spec.js4
-rw-r--r--spec/javascripts/ide/stores/actions/file_spec.js16
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/javascripts/ide/lib/common/model_spec.js b/spec/javascripts/ide/lib/common/model_spec.js
index 7a6c22b6d27..c278bf92b08 100644
--- a/spec/javascripts/ide/lib/common/model_spec.js
+++ b/spec/javascripts/ide/lib/common/model_spec.js
@@ -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', () => {
diff --git a/spec/javascripts/ide/stores/actions/file_spec.js b/spec/javascripts/ide/stores/actions/file_spec.js
index 3ef5a859001..7bebc2288e3 100644
--- a/spec/javascripts/ide/stores/actions/file_spec.js
+++ b/spec/javascripts/ide/stores/actions/file_spec.js
@@ -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';