test(editor): Add the missing setNotify stub to the app init useToast mock (no-changelog) (#35448)

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Alex Grozav 2026-08-03 17:44:03 +03:00 committed by GitHub
parent e62417356f
commit a78fcafbca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,6 +28,12 @@ const showToast = vi.fn();
vi.mock('@n8n/composables/useToast', () => ({
useToast: () => ({ showMessage, showToast }),
// The factory replaces the whole module, so it has to name every export the
// real one has. Nothing here asserts on `setNotify` — its only caller,
// `toastNotifier`, is kept out of this graph by the mock below — so dropping
// this line looks safe and stays green. Loosen that mock and it is not:
// vitest fails every test with `No "setNotify" export is defined`.
setNotify: vi.fn(),
}));
vi.mock('@/app/init/toastNotifier', () => ({