refactor(editor): Move editor-ui and design-system to frontend dir (no-changelog) (#13564)

This commit is contained in:
Alex Grozav
2025-02-28 14:28:30 +02:00
committed by GitHub
parent 684353436d
commit f5743176e5
1635 changed files with 805 additions and 1079 deletions

View File

@@ -0,0 +1,39 @@
import { render, screen } from '@testing-library/vue';
import N8nAlert from './Alert.vue';
import N8nIcon from '../N8nIcon';
describe('components', () => {
describe('N8nAlert', () => {
it('should render with props', () => {
render(N8nAlert, {
props: { title: 'Title', description: 'Message' },
});
expect(screen.getByRole('alert')).toBeVisible();
expect(screen.getByText('Title')).toBeVisible();
expect(screen.getByText('Message')).toBeVisible();
});
it('should render slots instead of props', () => {
const { container } = render(N8nAlert, {
props: { showIcon: false },
slots: {
title: 'Title',
default: 'Message',
aside: '<button>Click me</button>',
icon: '<n8n-icon icon="plus-circle" />',
},
global: {
components: {
'n8n-icon': N8nIcon,
},
},
});
expect(screen.getByRole('alert')).toBeVisible();
expect(screen.getByText('Title')).toBeVisible();
expect(screen.getByText('Message')).toBeVisible();
expect(screen.getByRole('button')).toBeVisible();
expect(container.querySelector('.n8n-icon')).toBeInTheDocument();
});
});
});