diff options
author | Clement Ho <408677-ClemMakesApps@users.noreply.gitlab.com> | 2019-09-09 21:52:27 +0000 |
---|---|---|
committer | Clement Ho <408677-ClemMakesApps@users.noreply.gitlab.com> | 2019-09-09 21:52:27 +0000 |
commit | 71e44e7ce3e2b0359b13d417162cb5a483e27242 (patch) | |
tree | 8d43c94667b46df99adf4bfc2827f2cc746524ea /spec | |
parent | 96480a31abf1190438aa142d44756a5177b6ac35 (diff) | |
parent | b5b2879e4a0854165c9485a36bbee8bcc6d83f84 (diff) | |
download | gitlab-ce-71e44e7ce3e2b0359b13d417162cb5a483e27242.tar.gz |
Merge branch 'jivanvl-add-caret-icon-dashboard' into 'master'
Add caret icons to the monitoring dashboard
See merge request gitlab-org/gitlab-ce!32239
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/monitoring/components/graph_group_spec.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/spec/javascripts/monitoring/components/graph_group_spec.js b/spec/javascripts/monitoring/components/graph_group_spec.js new file mode 100644 index 00000000000..068c4b5302c --- /dev/null +++ b/spec/javascripts/monitoring/components/graph_group_spec.js @@ -0,0 +1,47 @@ +import { shallowMount } from '@vue/test-utils'; +import GraphGroup from '~/monitoring/components/graph_group.vue'; + +describe('Graph group component', () => { + let graphGroup; + + afterEach(() => { + graphGroup.destroy(); + }); + + describe('When groups can be collapsed', () => { + beforeEach(() => { + graphGroup = shallowMount(GraphGroup, { + propsData: { + name: 'panel', + collapseGroup: true, + }, + }); + }); + + it('should show the angle-down caret icon when collapseGroup is true', () => { + expect(graphGroup.vm.caretIcon).toBe('angle-down'); + }); + + it('should show the angle-right caret icon when collapseGroup is false', () => { + graphGroup.vm.collapse(); + + expect(graphGroup.vm.caretIcon).toBe('angle-right'); + }); + }); + + describe('When groups can not be collapsed', () => { + beforeEach(() => { + graphGroup = shallowMount(GraphGroup, { + propsData: { + name: 'panel', + collapseGroup: true, + showPanels: false, + }, + }); + }); + + it('should not contain a prometheus-graph-group container when showPanels is false', () => { + expect(graphGroup.vm.$el.querySelector('.prometheus-graph-group')).toBe(null); + }); + }); +}); |