summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/javascripts/jobs/sidebar_detail_row_spec.js34
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');
+ });
});
});