forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(editor): Do not show mapping discoverability tooltip after dismiss (
n8n-io#6862) * fix(editor): Do not show mapping discoverability tooltip after dismiss * test: add tooltip design system component test * fix(editor): no need to dismiss mapping tooltip multiple times
- Loading branch information
Showing
4 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
packages/design-system/src/components/N8nTooltip/__tests__/Tooltip.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { render } from '@testing-library/vue'; | ||
import userEvent from '@testing-library/user-event'; | ||
import N8nTooltip from '../Tooltip.vue'; | ||
|
||
describe('components', () => { | ||
describe('N8nTooltip', () => { | ||
it('should work correctly', async () => { | ||
const buttonSpy = vi.fn(); | ||
|
||
const { getByText } = render(N8nTooltip, { | ||
props: { | ||
teleported: false, | ||
buttons: [ | ||
{ | ||
attrs: { | ||
label: 'Button 1', | ||
}, | ||
listeners: { | ||
onClick: buttonSpy, | ||
}, | ||
}, | ||
], | ||
}, | ||
slots: { | ||
default: '<span>Wrapped content</span>', | ||
content: '<span>Tooltip content</span>', | ||
}, | ||
}); | ||
expect(getByText('Wrapped content')).toBeVisible(); | ||
expect(getByText('Tooltip content')).not.toBeVisible(); | ||
|
||
await userEvent.hover(getByText('Wrapped content')); | ||
expect(getByText('Tooltip content')).toBeVisible(); | ||
|
||
await userEvent.click(getByText('Button 1')); | ||
expect(buttonSpy).toHaveBeenCalled(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters