diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-07 23:53:15 +0100 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-28 13:58:16 +0200 |
commit | 4c3482345a3bcc9ac5d29f5dbc55c966ca5a0c72 (patch) | |
tree | ab573f3b782571b552ccba1d37c7821ac5eefc0e /spec/javascripts/jobs | |
parent | 12401758a40868b1683c2c208d756105fd43de7b (diff) | |
download | gitlab-ce-4c3482345a3bcc9ac5d29f5dbc55c966ca5a0c72.tar.gz |
Fix sidebar_detail_row_spec.js
Diffstat (limited to 'spec/javascripts/jobs')
-rw-r--r-- | spec/javascripts/jobs/sidebar_detail_row_spec.js | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/spec/javascripts/jobs/sidebar_detail_row_spec.js b/spec/javascripts/jobs/sidebar_detail_row_spec.js index 9fe5cf78b8b..e6bfb0c4adc 100644 --- a/spec/javascripts/jobs/sidebar_detail_row_spec.js +++ b/spec/javascripts/jobs/sidebar_detail_row_spec.js @@ -38,20 +38,24 @@ describe('Sidebar detail row', () => { ).toEqual('this is the title: this is the value'); }); - it('should not render help when helpUrl not provided', () => { - expect(vm.$el.querySelector('.help-button')).toBeUndefined(); - }); - - beforeEach(() => { - vm = new SidebarDetailRow({ - propsData: { - helpUrl: 'help url', - value: 'foo', - }, - }).$mount(); - }); - - it('should render help when helpUrl is provided', () => { - expect(vm.$el.querySelector('.help-button a').getAttribute('href')).toEqual('help url'); + describe('when helpUrl not provided', () => { + it('should not render help', () => { + expect(vm.$el.querySelector('.help-button')).toBeNull(); + }); + }); + + describe('when helpUrl provided', () => { + beforeEach(() => { + vm = new SidebarDetailRow({ + propsData: { + helpUrl: 'help url', + value: 'foo', + }, + }).$mount(); + }); + + it('should render help', () => { + expect(vm.$el.querySelector('.help-button a').getAttribute('href')).toEqual('help url'); + }); }); }); |