Skip to content

Commit 2293a7d

Browse files
committed
test(ui-web): add explicit afterEach mock cleanup in SimulatorBar test
Aligns SimulatorBar.test.ts with the dominant convention in ui/web's test suite (Dialogs, StationCard, ConnectorRow, ClassicLayout, Actions, …), which all add an explicit `afterEach(() => { vi.clearAllMocks() })` alongside vitest.config.ts's global `clearMocks: true` / `restoreMocks: true`. Belt-and-braces: the explicit reset keeps mock lifecycle visible next to the mock declarations, even though it is technically redundant with the global flags.
1 parent ed42e4c commit 2293a7d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ui/web/tests/unit/skins/modern/SimulatorBar.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
import { mount } from '@vue/test-utils'
66
import { SKIN_IDS, THEME_IDS } from 'ui-common'
7-
import { describe, expect, it, vi } from 'vitest'
7+
import { afterEach, describe, expect, it, vi } from 'vitest'
88

99
import SimulatorBar from '@/skins/modern/components/SimulatorBar.vue'
1010

@@ -65,6 +65,10 @@ function mountBar (props: Record<string, unknown> = {}) {
6565
}
6666

6767
describe('SimulatorBar', () => {
68+
afterEach(() => {
69+
vi.clearAllMocks()
70+
})
71+
6872
it('should show Disconnected pill when simulatorState is undefined', () => {
6973
const wrapper = mountBar()
7074
expect(wrapper.text()).toContain('Disconnected')

0 commit comments

Comments
 (0)