Change forceRedraw key format
This commit is contained in:
parent
efedd968fb
commit
6ff8146dc2
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue