mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00: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:
@@ -268,7 +268,6 @@ describe('Data mapping', () => {
|
|||||||
|
|
||||||
ndv.actions.typeIntoParameterInput('value', 'fun');
|
ndv.actions.typeIntoParameterInput('value', 'fun');
|
||||||
ndv.actions.clearParameterInput('value'); // keep focus on param
|
ndv.actions.clearParameterInput('value'); // keep focus on param
|
||||||
ndv.actions.dismissMappingTooltip();
|
|
||||||
cy.wait(300);
|
cy.wait(300);
|
||||||
|
|
||||||
ndv.getters.inputDataContainer().should('exist').find('span').contains('count').realMouseDown();
|
ndv.getters.inputDataContainer().should('exist').find('span').contains('count').realMouseDown();
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ TooltipWithButtons.args = {
|
|||||||
'data-test-id': 'tooltip-button',
|
'data-test-id': 'tooltip-button',
|
||||||
},
|
},
|
||||||
listeners: {
|
listeners: {
|
||||||
click: () => alert('Clicked 1'),
|
onClick: () => alert('Clicked 1'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -68,7 +68,7 @@ TooltipWithButtons.args = {
|
|||||||
'data-test-id': 'tooltip-button',
|
'data-test-id': 'tooltip-button',
|
||||||
},
|
},
|
||||||
listeners: {
|
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',
|
'data-test-id': 'dismiss-mapping-tooltip',
|
||||||
},
|
},
|
||||||
listeners: {
|
listeners: {
|
||||||
click: mappingTooltipDismissHandler,
|
onClick: mappingTooltipDismissHandler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user