Skip to content

Commit 45b8216

Browse files
committed
refactor(tests): simplify mock implementation for event dispatch in context navigation tests
1 parent 714090d commit 45b8216

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

packages/plugins/context-navigation/src/__tests__/plugin.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,10 @@ describe('createContextNavigationPlugin', () => {
212212

213213
it('skips with canceled when navigation event is canceled', async () => {
214214
harness = createHarness();
215-
vi.mocked(harness.event.dispatchEvent).mockImplementation(
216-
async (name: unknown) => {
217-
if (name === 'onContextNavigationNavigate') return { canceled: true } as never;
218-
return { canceled: false } as never;
219-
},
220-
);
215+
vi.mocked(harness.event.dispatchEvent).mockImplementation(async (name: unknown) => {
216+
if (name === 'onContextNavigationNavigate') return { canceled: true } as never;
217+
return { canceled: false } as never;
218+
});
221219
const appModules = { context: { currentContext: null } } as unknown as AppModulesInstance<
222220
[ContextModule]
223221
>;

0 commit comments

Comments
 (0)