Skip to content

Commit

Permalink
Merge pull request #1819 from MetRonnie/event-bus
Browse files Browse the repository at this point in the history
Clean up event listener; fix warning in test
  • Loading branch information
oliver-sanders committed Jun 18, 2024
2 parents 4f2de6a + 87d8e88 commit edd69f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/components/cylc/workspace/Widget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</template>

<script setup>
import { provide, readonly, ref } from 'vue'
import { onBeforeUnmount, provide, readonly, ref } from 'vue'
import { eventBus } from '@/services/eventBus'
const props = defineProps({
Expand All @@ -50,4 +50,8 @@ provide('animResetTime', readonly(animResetTime))
eventBus.on(`lumino:show:${props.id}`, () => {
animResetTime.value = Date.now()
})
onBeforeUnmount(() => {
eventBus.off(`lumino:show:${props.id}`)
})
</script>
8 changes: 0 additions & 8 deletions tests/unit/components/cylc/gscan/gscan.vue.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
*/

import { mount } from '@vue/test-utils'
import { createStore } from 'vuex'
import { createVuetify } from 'vuetify'
import storeOptions from '@/store/options'
import GScan from '@/components/cylc/gscan/GScan.vue'
import CommandMenuPlugin from '@/components/cylc/commandMenu/plugin'
import {
Expand Down Expand Up @@ -49,12 +47,6 @@ function filterNodes (wrapper, filteredOutNodesCache) {
}

describe('GScan component', () => {
const store = createStore(storeOptions)
const resetState = () => {
store.commit('workflows/SET_WORKFLOW_NAME', null)
}
beforeEach(resetState)

describe('Sorting', () => {
it('sets workflow sort order by status', () => {
// for each worflow state ...
Expand Down

0 comments on commit edd69f8

Please sign in to comment.