mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix(editor): Do not show mapping discoverability tooltip after dismiss (#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
This commit is contained in:
parent
efe08cced3
commit
08982ede4c
|
@ -268,7 +268,6 @@ describe('Data mapping', () => {
|
|||
|
||||
ndv.actions.typeIntoParameterInput('value', 'fun');
|
||||
ndv.actions.clearParameterInput('value'); // keep focus on param
|
||||
ndv.actions.dismissMappingTooltip();
|
||||
cy.wait(300);
|
||||
|
||||
ndv.getters.inputDataContainer().should('exist').find('span').contains('count').realMouseDown();
|
||||
|
|
|
@ -59,7 +59,7 @@ TooltipWithButtons.args = {
|
|||
'data-test-id': 'tooltip-button',
|
||||
},
|
||||
listeners: {
|
||||
click: () => alert('Clicked 1'),
|
||||
onClick: () => alert('Clicked 1'),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -68,7 +68,7 @@ TooltipWithButtons.args = {
|
|||
'data-test-id': 'tooltip-button',
|
||||
},
|
||||
listeners: {
|
||||
click: () => alert('Clicked 2'),
|
||||
onClick: () => alert('Clicked 2'),
|
||||
},
|
||||
},
|
||||
],
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
|
@ -169,7 +169,7 @@ export default defineComponent({
|
|||
'data-test-id': 'dismiss-mapping-tooltip',
|
||||
},
|
||||
listeners: {
|
||||
click: mappingTooltipDismissHandler,
|
||||
onClick: mappingTooltipDismissHandler,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue