Commit 1e661088 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch...

Merge branch '34734-monitor-dashboard-does-not-expand-sections-that-have-data-on-load' into 'master'

Monitor dashboard does not expand sections that have data on load

Closes #34734

See merge request gitlab-org/gitlab!20312
parents 42b65e07 47b4c986
...@@ -30,9 +30,6 @@ export default { ...@@ -30,9 +30,6 @@ export default {
return this.collapseGroup && this.showGroup ? 'angle-down' : 'angle-right'; return this.collapseGroup && this.showGroup ? 'angle-down' : 'angle-right';
}, },
}, },
created() {
this.showGroup = this.collapseGroup;
},
methods: { methods: {
collapse() { collapse() {
this.showGroup = !this.showGroup; this.showGroup = !this.showGroup;
......
---
title: Fix graph groups in monitor dashboard that are hidden on load
merge_request: 20312
author:
type: fixed
...@@ -3,6 +3,8 @@ import GraphGroup from '~/monitoring/components/graph_group.vue'; ...@@ -3,6 +3,8 @@ import GraphGroup from '~/monitoring/components/graph_group.vue';
describe('Graph group component', () => { describe('Graph group component', () => {
let graphGroup; let graphGroup;
const findPrometheusGroup = () => graphGroup.find('.prometheus-graph-group');
const findPrometheusPanel = () => graphGroup.find('.prometheus-panel');
afterEach(() => { afterEach(() => {
graphGroup.destroy(); graphGroup.destroy();
...@@ -40,8 +42,32 @@ describe('Graph group component', () => { ...@@ -40,8 +42,32 @@ describe('Graph group component', () => {
}); });
}); });
it('should not contain a prometheus-graph-group container when showPanels is false', () => { it('should not contain a prometheus-panel container when showPanels is false', () => {
expect(graphGroup.vm.$el.querySelector('.prometheus-graph-group')).toBe(null); expect(findPrometheusPanel().exists()).toBe(false);
});
});
describe('When collapseGroup prop is updated', () => {
beforeEach(() => {
graphGroup = shallowMount(GraphGroup, {
propsData: {
name: 'panel',
collapseGroup: false,
},
});
});
it('previously collapsed group should respond to the prop change', done => {
expect(findPrometheusGroup().exists()).toBe(false);
graphGroup.setProps({
collapseGroup: true,
});
graphGroup.vm.$nextTick(() => {
expect(findPrometheusGroup().exists()).toBe(true);
done();
});
}); });
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment