mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(editor): Detangle ui store from settings store (no-changelog) (#16384)
This commit is contained in:
@@ -15,6 +15,7 @@ import { STORES } from '@n8n/stores';
|
||||
import { useSSOStore } from '@/stores/sso.store';
|
||||
import { UserManagementAuthenticationMethod } from '@/Interface';
|
||||
import { EnterpriseEditionFeature } from '@/constants';
|
||||
import { useUIStore } from '@/stores/ui.store';
|
||||
|
||||
const showMessage = vi.fn();
|
||||
|
||||
@@ -38,6 +39,7 @@ describe('Init', () => {
|
||||
let nodeTypesStore: ReturnType<typeof useNodeTypesStore>;
|
||||
let versionsStore: ReturnType<typeof useVersionsStore>;
|
||||
let ssoStore: ReturnType<typeof useSSOStore>;
|
||||
let uiStore: ReturnType<typeof useUIStore>;
|
||||
|
||||
beforeEach(() => {
|
||||
setActivePinia(
|
||||
@@ -56,6 +58,7 @@ describe('Init', () => {
|
||||
versionsStore = useVersionsStore();
|
||||
versionsStore = useVersionsStore();
|
||||
ssoStore = useSSOStore();
|
||||
uiStore = useUIStore();
|
||||
});
|
||||
|
||||
describe('initializeCore()', () => {
|
||||
@@ -104,6 +107,18 @@ describe('Init', () => {
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('should initialize uiStore with banners based on settings', async () => {
|
||||
settingsStore.isEnterpriseFeatureEnabled.showNonProdBanner = true;
|
||||
settingsStore.settings.banners = { dismissed: [] };
|
||||
settingsStore.settings.versionCli = '1.2.3';
|
||||
|
||||
await initializeCore();
|
||||
|
||||
expect(uiStore.initialize).toHaveBeenCalledWith({
|
||||
banners: ['NON_PRODUCTION_LICENSE', 'V1'],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('initializeAuthenticatedFeatures()', () => {
|
||||
|
||||
Reference in New Issue
Block a user