diff --git a/src/components/WidgetCreationDateOverTime.vue b/src/components/WidgetCreationDateOverTime.vue index 42a3a79a8e..d30267831b 100644 --- a/src/components/WidgetCreationDateOverTime.vue +++ b/src/components/WidgetCreationDateOverTime.vue @@ -57,6 +57,7 @@ export default { }, watch: { index () { + this.$set(this, 'mounted', false) this.init() } }, @@ -64,7 +65,7 @@ export default { this.$nextTick(() => this.init()) }, computed: { - ...mapState('search', ['index']), + ...mapState('insights', ['index']), container () { return this.mounted ? this.$el.querySelector('.widget__content__chart') : null }, diff --git a/tests/unit/specs/components/WidgetCreationDateOverTime.spec.js b/tests/unit/specs/components/WidgetCreationDateOverTime.spec.js index 7ade2a0d60..f6906a7479 100644 --- a/tests/unit/specs/components/WidgetCreationDateOverTime.spec.js +++ b/tests/unit/specs/components/WidgetCreationDateOverTime.spec.js @@ -49,7 +49,7 @@ describe('WidgetCreationDateOverTime.vue', () => { const init = jest.spyOn(wrapper.vm, 'init') await wrapper.vm.$nextTick() expect(init).toBeCalledTimes(1) - await store.commit('search/index', anotherIndex) + await store.commit('insights/index', anotherIndex) expect(init).toBeCalledTimes(2) })