Fix sidebar_detail_row_spec.js

This commit is contained in:
Tomasz Maczukin 2018-03-07 23:53:15 +01:00
parent 12401758a4
commit 4c3482345a
No known key found for this signature in database
GPG Key ID: 7E9EB2E4B0F625CD
1 changed files with 16 additions and 12 deletions

View File

@ -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();
describe('when helpUrl not provided', () => {
it('should not render help', () => {
expect(vm.$el.querySelector('.help-button')).toBeNull();
});
});
beforeEach(() => {
vm = new SidebarDetailRow({
propsData: {
helpUrl: 'help url',
value: 'foo',
},
}).$mount();
});
describe('when helpUrl provided', () => {
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');
it('should render help', () => {
expect(vm.$el.querySelector('.help-button a').getAttribute('href')).toEqual('help url');
});
});
});