diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-01-19 09:38:34 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-01-19 09:38:34 +0000 |
commit | e79db43d2cf269beec700353e776e92b15ac9af9 (patch) | |
tree | 5e4a6ab9b4843c58288c670d5eabe7ff2f31fee1 /spec | |
parent | dd633dc48f00f779755370e3849691dc776b5055 (diff) | |
download | gitlab-ce-e79db43d2cf269beec700353e776e92b15ac9af9.tar.gz |
WebIDE: Fix Commit bugs
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/flash_spec.js | 12 | ||||
-rw-r--r-- | spec/javascripts/lib/utils/text_utility_spec.js | 6 | ||||
-rw-r--r-- | spec/javascripts/repo/stores/actions_spec.js | 13 | ||||
-rw-r--r-- | spec/javascripts/vue_shared/components/loading_icon_spec.js | 3 |
4 files changed, 15 insertions, 19 deletions
diff --git a/spec/javascripts/flash_spec.js b/spec/javascripts/flash_spec.js index 97e3ab682c5..7198dbd4cf2 100644 --- a/spec/javascripts/flash_spec.js +++ b/spec/javascripts/flash_spec.js @@ -183,11 +183,15 @@ describe('Flash', () => { }); it('adds flash element into container', () => { - flash('test'); + flash('test', 'alert', document, null, false, true); expect( document.querySelector('.flash-alert'), ).not.toBeNull(); + + expect( + document.body.className, + ).toContain('flash-shown'); }); it('adds flash into specified parent', () => { @@ -220,13 +224,17 @@ describe('Flash', () => { }); it('removes element after clicking', () => { - flash('test', 'alert', document, null, false); + flash('test', 'alert', document, null, false, true); document.querySelector('.flash-alert').click(); expect( document.querySelector('.flash-alert'), ).toBeNull(); + + expect( + document.body.className, + ).not.toContain('flash-shown'); }); describe('with actionConfig', () => { diff --git a/spec/javascripts/lib/utils/text_utility_spec.js b/spec/javascripts/lib/utils/text_utility_spec.js index 6f8dad6b835..69a23d7b2f3 100644 --- a/spec/javascripts/lib/utils/text_utility_spec.js +++ b/spec/javascripts/lib/utils/text_utility_spec.js @@ -63,13 +63,13 @@ describe('text_utility', () => { }); }); - describe('stripeHtml', () => { + describe('stripHtml', () => { it('replaces html tag with the default replacement', () => { - expect(textUtils.stripeHtml('This is a text with <p>html</p>.')).toEqual('This is a text with html.'); + expect(textUtils.stripHtml('This is a text with <p>html</p>.')).toEqual('This is a text with html.'); }); it('replaces html tags with the provided replacement', () => { - expect(textUtils.stripeHtml('This is a text with <p>html</p>.', ' ')).toEqual('This is a text with html .'); + expect(textUtils.stripHtml('This is a text with <p>html</p>.', ' ')).toEqual('This is a text with html .'); }); }); }); diff --git a/spec/javascripts/repo/stores/actions_spec.js b/spec/javascripts/repo/stores/actions_spec.js index 0b0d34f072a..853ef7f3224 100644 --- a/spec/javascripts/repo/stores/actions_spec.js +++ b/spec/javascripts/repo/stores/actions_spec.js @@ -300,19 +300,6 @@ describe('Multi-file store actions', () => { }).catch(done.fail); }); - it('closes all files', (done) => { - store.state.openFiles.push(file()); - store.state.openFiles[0].opened = true; - - store.dispatch('commitChanges', { payload, newMr: false }) - .then(Vue.nextTick) - .then(() => { - expect(store.state.openFiles.length).toBe(0); - - done(); - }).catch(done.fail); - }); - it('scrolls to top of page', (done) => { store.dispatch('commitChanges', { payload, newMr: false }) .then(() => { diff --git a/spec/javascripts/vue_shared/components/loading_icon_spec.js b/spec/javascripts/vue_shared/components/loading_icon_spec.js index 1baf3537741..5cd3466f501 100644 --- a/spec/javascripts/vue_shared/components/loading_icon_spec.js +++ b/spec/javascripts/vue_shared/components/loading_icon_spec.js @@ -16,7 +16,8 @@ describe('Loading Icon Component', () => { ).toEqual('fa fa-spin fa-spinner fa-1x'); expect(component.$el.tagName).toEqual('DIV'); - expect(component.$el.classList.contains('text-center')).toEqual(true); + expect(component.$el.classList).toContain('text-center'); + expect(component.$el.classList).toContain('loading-container'); }); it('should render accessibility attributes', () => { |