mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 12:19:09 +00:00
refactor(editor): Move user login and logout side effects into hooks (no-changelog) (#16663)
This commit is contained in:
@@ -2,7 +2,7 @@ import type { CurrentUserResponse } from '@/Interface';
|
||||
import { useUsersStore } from './users.store';
|
||||
import { createPinia, setActivePinia } from 'pinia';
|
||||
|
||||
const { loginCurrentUser, identify, inviteUsers } = vi.hoisted(() => {
|
||||
const { loginCurrentUser, inviteUsers } = vi.hoisted(() => {
|
||||
return {
|
||||
loginCurrentUser: vi.fn(),
|
||||
identify: vi.fn(),
|
||||
@@ -18,12 +18,6 @@ vi.mock('@/api/invitation', () => ({
|
||||
inviteUsers,
|
||||
}));
|
||||
|
||||
vi.mock('@/composables/useTelemetry', () => ({
|
||||
useTelemetry: vi.fn(() => ({
|
||||
identify,
|
||||
})),
|
||||
}));
|
||||
|
||||
vi.mock('@n8n/stores/useRootStore', () => ({
|
||||
useRootStore: vi.fn(() => ({
|
||||
instanceId: 'test-instance-id',
|
||||
@@ -59,8 +53,6 @@ describe('users.store', () => {
|
||||
isDefaultUser: false,
|
||||
isPendingUser: false,
|
||||
});
|
||||
|
||||
expect(identify).toHaveBeenCalledWith('test-instance-id', mockUser.id);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user