mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
feat(editor): Add universal Create Resource Menu (#11564)
Co-authored-by: Csaba Tuncsik <csaba@n8n.io>
This commit is contained in:
committed by
GitHub
parent
1d8fd13d84
commit
b38ce14ec9
@@ -29,9 +29,10 @@ describe('N8nNavigationDropdown', () => {
|
||||
|
||||
await router.isReady();
|
||||
});
|
||||
|
||||
it('default slot should trigger first level', async () => {
|
||||
const { getByTestId, queryByTestId } = render(NavigationDropdown, {
|
||||
slots: { default: h('button', { ['data-test-id']: 'test-trigger' }) },
|
||||
slots: { default: h('button', { 'data-test-id': 'test-trigger' }) },
|
||||
props: { menu: [{ id: 'aaa', title: 'aaa', route: { name: 'projects' } }] },
|
||||
global: {
|
||||
plugins: [router],
|
||||
@@ -40,13 +41,13 @@ describe('N8nNavigationDropdown', () => {
|
||||
expect(getByTestId('test-trigger')).toBeVisible();
|
||||
expect(queryByTestId('navigation-menu-item')).not.toBeVisible();
|
||||
|
||||
await userEvent.hover(getByTestId('test-trigger'));
|
||||
await userEvent.click(getByTestId('test-trigger'));
|
||||
await waitFor(() => expect(queryByTestId('navigation-menu-item')).toBeVisible());
|
||||
});
|
||||
|
||||
it('redirect to route', async () => {
|
||||
const { getByTestId, queryByTestId } = render(NavigationDropdown, {
|
||||
slots: { default: h('button', { ['data-test-id']: 'test-trigger' }) },
|
||||
slots: { default: h('button', { 'data-test-id': 'test-trigger' }) },
|
||||
props: {
|
||||
menu: [
|
||||
{
|
||||
@@ -64,7 +65,7 @@ describe('N8nNavigationDropdown', () => {
|
||||
expect(getByTestId('test-trigger')).toBeVisible();
|
||||
expect(queryByTestId('navigation-submenu')).not.toBeVisible();
|
||||
|
||||
await userEvent.hover(getByTestId('test-trigger'));
|
||||
await userEvent.click(getByTestId('test-trigger'));
|
||||
|
||||
await waitFor(() => expect(getByTestId('navigation-submenu')).toBeVisible());
|
||||
|
||||
@@ -75,7 +76,7 @@ describe('N8nNavigationDropdown', () => {
|
||||
|
||||
it('should render icons in submenu when provided', () => {
|
||||
const { getByTestId } = render(NavigationDropdown, {
|
||||
slots: { default: h('button', { ['data-test-id']: 'test-trigger' }) },
|
||||
slots: { default: h('button', { 'data-test-id': 'test-trigger' }) },
|
||||
props: {
|
||||
menu: [
|
||||
{
|
||||
@@ -95,7 +96,7 @@ describe('N8nNavigationDropdown', () => {
|
||||
|
||||
it('should propagate events', async () => {
|
||||
const { getByTestId, emitted } = render(NavigationDropdown, {
|
||||
slots: { default: h('button', { ['data-test-id']: 'test-trigger' }) },
|
||||
slots: { default: h('button', { 'data-test-id': 'test-trigger' }) },
|
||||
props: {
|
||||
menu: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user