summaryrefslogtreecommitdiff
path: root/spec/javascripts/monitoring/dashboard_spec.js
diff options
context:
space:
mode:
authorAdriel Santiago <adriel@gitlab.com>2019-01-23 18:06:40 -0500
committerAdriel Santiago <adriel@gitlab.com>2019-02-04 08:04:45 -0500
commitc974f4a82ee3cd4b5b73b95d66d99854a0e5d3bc (patch)
tree183122acce41af316c31515c5c7431e886db282b /spec/javascripts/monitoring/dashboard_spec.js
parent2b0f4df0217b4a4aee53f964610d66ceedb68dca (diff)
downloadgitlab-ce-c974f4a82ee3cd4b5b73b95d66d99854a0e5d3bc.tar.gz
Handle window and container resize events
Resizes metrics graph on window and sidebard width changes
Diffstat (limited to 'spec/javascripts/monitoring/dashboard_spec.js')
-rw-r--r--spec/javascripts/monitoring/dashboard_spec.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/javascripts/monitoring/dashboard_spec.js b/spec/javascripts/monitoring/dashboard_spec.js
index 565b87de248..97b9671c809 100644
--- a/spec/javascripts/monitoring/dashboard_spec.js
+++ b/spec/javascripts/monitoring/dashboard_spec.js
@@ -29,7 +29,7 @@ describe('Dashboard', () => {
beforeEach(() => {
setFixtures(`
<div class="prometheus-graphs"></div>
- <div class="nav-sidebar"></div>
+ <div class="layout-page"></div>
`);
DashboardComponent = Vue.extend(Dashboard);
});
@@ -164,16 +164,16 @@ describe('Dashboard', () => {
jasmine.clock().uninstall();
});
- it('rerenders the dashboard when the sidebar is resized', done => {
+ it('sets elWidth to page width when the sidebar is resized', done => {
const component = new DashboardComponent({
el: document.querySelector('.prometheus-graphs'),
propsData: { ...propsData, hasMetrics: true, showPanels: false },
});
- expect(component.forceRedraw).toEqual(0);
+ expect(component.elWidth).toEqual(0);
- const navSidebarEl = document.querySelector('.nav-sidebar');
- navSidebarEl.classList.add('nav-sidebar-collapsed');
+ const pageLayoutEl = document.querySelector('.layout-page');
+ pageLayoutEl.classList.add('page-with-icon-sidebar');
Vue.nextTick()
.then(() => {
@@ -181,7 +181,7 @@ describe('Dashboard', () => {
return Vue.nextTick();
})
.then(() => {
- expect(component.forceRedraw).toEqual(component.elWidth);
+ expect(component.elWidth).toEqual(pageLayoutEl.clientWidth);
done();
})
.catch(done.fail);