Change forceRedraw key format

This commit is contained in:
Jose Vargas 2018-09-25 16:43:43 -05:00
parent efedd968fb
commit 6ff8146dc2
No known key found for this signature in database
GPG Key ID: 01F49A6AE27697FB
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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);