Change forceRedraw key format

parent efedd968
Pipeline #31201073 passed with stages
in 37 minutes and 43 seconds
......@@ -98,12 +98,12 @@ export default {
state: 'gettingStarted',
showEmptyState: true,
hoverData: {},
updateDashboardKeyNumber: 0,
elWidth: 0,
};
},
computed: {
forceRedraw() {
return `dashboard-key-${this.updateDashboardKeyNumber}`;
return this.elWidth;
},
},
created() {
......@@ -165,7 +165,7 @@ export default {
});
},
resize() {
this.updateDashboardKeyNumber += 1;
this.elWidth = this.$el.clientWidth;
},
hoverChanged(data) {
this.hoverData = data;
......
......@@ -150,7 +150,7 @@ describe('Dashboard', () => {
propsData: { ...propsData, hasMetrics: true, showPanels: false },
});
expect(component.forceRedraw).toEqual('dashboard-key-0');
expect(component.forceRedraw).toEqual(0);
const navSidebarEl = document.querySelector('.nav-sidebar');
navSidebarEl.classList.add('nav-sidebar-collapsed');
......@@ -161,7 +161,7 @@ describe('Dashboard', () => {
return Vue.nextTick();
})
.then(() => {
expect(component.forceRedraw).toEqual('dashboard-key-1');
expect(component.forceRedraw).toEqual(component.elWidth);
done();
})
.catch(done.fail);
......
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