diff options
Diffstat (limited to 'spec/frontend/pipelines/graph/graph_view_selector_spec.js')
-rw-r--r-- | spec/frontend/pipelines/graph/graph_view_selector_spec.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/spec/frontend/pipelines/graph/graph_view_selector_spec.js b/spec/frontend/pipelines/graph/graph_view_selector_spec.js index 43587bebedf..65ae9d19978 100644 --- a/spec/frontend/pipelines/graph/graph_view_selector_spec.js +++ b/spec/frontend/pipelines/graph/graph_view_selector_spec.js @@ -42,10 +42,6 @@ describe('the graph view selector component', () => { }); }; - afterEach(() => { - wrapper.destroy(); - }); - describe('when showing stage view', () => { beforeEach(() => { createComponent({ mountFn: mount }); @@ -148,6 +144,7 @@ describe('the graph view selector component', () => { createComponent({ props: { showLinks: true, + type: LAYER_VIEW, }, data: { showLinksActive: true, @@ -166,6 +163,18 @@ describe('the graph view selector component', () => { await findHoverTip().find('button').trigger('click'); expect(wrapper.emitted().dismissHoverTip).toHaveLength(1); }); + + it('is displayed at first then hidden on swith to STAGE_VIEW then displayed on switch to LAYER_VIEW', async () => { + expect(findHoverTip().exists()).toBe(true); + expect(findHoverTip().text()).toBe(wrapper.vm.$options.i18n.hoverTipText); + + await findStageViewButton().trigger('click'); + expect(findHoverTip().exists()).toBe(false); + + await findLayerViewButton().trigger('click'); + expect(findHoverTip().exists()).toBe(true); + expect(findHoverTip().text()).toBe(wrapper.vm.$options.i18n.hoverTipText); + }); }); describe('when links are live and it has been previously dismissed', () => { @@ -174,6 +183,7 @@ describe('the graph view selector component', () => { props: { showLinks: true, tipPreviouslyDismissed: true, + type: LAYER_VIEW, }, data: { showLinksActive: true, @@ -191,6 +201,7 @@ describe('the graph view selector component', () => { createComponent({ props: { showLinks: true, + type: LAYER_VIEW, }, data: { showLinksActive: false, |