mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
refactor(editor): Rename design-system unit test files and snapshots (no-changelog) (#11539)
This commit is contained in:
35
packages/editor-ui/src/components/banners/V1Banner.test.ts
Normal file
35
packages/editor-ui/src/components/banners/V1Banner.test.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { createComponentRenderer } from '@/__tests__/render';
|
||||
import V1Banner from './V1Banner.vue';
|
||||
import { createPinia, setActivePinia } from 'pinia';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import { ROLE } from '@/constants';
|
||||
import type { IUser } from '@/Interface';
|
||||
|
||||
const renderComponent = createComponentRenderer(V1Banner);
|
||||
|
||||
describe('V1 Banner', () => {
|
||||
let pinia: ReturnType<typeof createPinia>;
|
||||
let usersStore: ReturnType<typeof useUsersStore>;
|
||||
|
||||
beforeEach(async () => {
|
||||
pinia = createPinia();
|
||||
setActivePinia(pinia);
|
||||
|
||||
usersStore = useUsersStore();
|
||||
});
|
||||
|
||||
it('should render banner', () => {
|
||||
const { container } = renderComponent();
|
||||
expect(container).toMatchSnapshot();
|
||||
expect(container.querySelectorAll('a')).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('should render banner with dismiss call if user is owner', () => {
|
||||
usersStore.usersById = { '1': { role: ROLE.Owner } as IUser };
|
||||
usersStore.currentUserId = '1';
|
||||
|
||||
const { container } = renderComponent();
|
||||
expect(container).toMatchSnapshot();
|
||||
expect(container.querySelectorAll('a')).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user