mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor(editor): Move user login and logout side effects into hooks (no-changelog) (#16663)
This commit is contained in:
@@ -24,7 +24,11 @@ vi.mock('@/composables/useToast', () => ({
|
||||
}));
|
||||
|
||||
vi.mock('@/stores/users.store', () => ({
|
||||
useUsersStore: vi.fn().mockReturnValue({ initialize: vi.fn() }),
|
||||
useUsersStore: vi.fn().mockReturnValue({
|
||||
initialize: vi.fn(),
|
||||
registerLoginHook: vi.fn(),
|
||||
registerLogoutHook: vi.fn(),
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@n8n/stores/useRootStore', () => ({
|
||||
@@ -86,6 +90,16 @@ describe('Init', () => {
|
||||
expect(settingsStoreSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('should initialize authentication hooks', async () => {
|
||||
const registerLoginHookSpy = vi.spyOn(usersStore, 'registerLoginHook');
|
||||
const registerLogoutHookSpy = vi.spyOn(usersStore, 'registerLogoutHook');
|
||||
|
||||
await initializeCore();
|
||||
|
||||
expect(registerLoginHookSpy).toHaveBeenCalled();
|
||||
expect(registerLogoutHookSpy).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should initialize ssoStore with settings SSO configuration', async () => {
|
||||
const saml = { loginEnabled: true, loginLabel: '' };
|
||||
const ldap = { loginEnabled: false, loginLabel: '' };
|
||||
|
||||
Reference in New Issue
Block a user