-
Notifications
You must be signed in to change notification settings - Fork 51.5k
refactor(editor): Replace old N8nTooltip with new Reka UI based tooltip #22838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
BundleMonUnchanged files (2)
No change in files bundle size Groups updated (2)
Final result: ✅ View report in BundleMon website ➡️ |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
E2E Tests: n8n tests failed after 11m 19s Run Details
Failed Spec Files
Groups
This message was posted automatically by
currents.dev | Integration Settings
|
This comment has been minimized.
This comment has been minimized.
…use data attributes for better accessibility and consistency
…storyListItem test files
…Tooltip stubs and improve tooltip assertions
|
Found 3 test failures on Blacksmith runners: Failures
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 issues found across 46 files
Prompt for AI agents (all 5 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/frontend/@n8n/design-system/src/components/N8nTooltip/Tooltip.vue">
<violation number="1" location="packages/frontend/@n8n/design-system/src/components/N8nTooltip/Tooltip.vue:78">
P2: `N8nTooltip` drops all consumer attributes/listeners because `$attrs` is no longer forwarded while `inheritAttrs: false` is still set. Forward `$attrs` to `TooltipRoot` so props like `append-to`, `trigger`, and custom classes keep working.</violation>
</file>
<file name="packages/frontend/@n8n/design-system/src/components/N8nTooltip/Tooltip.test.ts">
<violation number="1" location="packages/frontend/@n8n/design-system/src/components/N8nTooltip/Tooltip.test.ts:355">
P2: The `buttons` test no longer verifies that the provided click listeners fire—`buttonSpy` is never exercised—so the test can’t catch regressions where button clicks stop working. Add a `userEvent.click` and assert the spy was called to cover the behavior.</violation>
</file>
<file name="packages/frontend/editor-ui/src/features/ndv/runData/components/RunDataPinButton.test.ts">
<violation number="1" location="packages/frontend/editor-ui/src/features/ndv/runData/components/RunDataPinButton.test.ts:43">
P2: This test no longer checks that the tooltip is absent before hovering, so a regression where the tooltip renders immediately would go undetected. Add an assertion that no `[data-dismissable-layer]` exists prior to `userEvent.hover` to keep the “only on hover” contract under test.</violation>
<violation number="2" location="packages/frontend/editor-ui/src/features/ndv/runData/components/RunDataPinButton.test.ts:58">
P2: This test also lost its pre-hover absence check, so it no longer verifies that the binary tooltip only appears after hovering the disabled button. Add a DOM assertion before the hover to keep the test aligned with its purpose.</violation>
</file>
<file name="packages/frontend/@n8n/design-system/src/v2/components/Tooltip/Tooltip.test.ts">
<violation number="1" location="packages/frontend/@n8n/design-system/src/v2/components/Tooltip/Tooltip.test.ts:17">
P1: Rule violated: **Tests**
Removing the entire Tooltip test suite violates the Community PR Guidelines §2 testing requirement—core Tooltip behavior now lacks any automated coverage after the refactor. Please replace the deleted tests with equivalent coverage for the new tooltip implementation.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| :class="$style.buttons" | ||
| :style="{ justifyContent: props.justifyButtons }" | ||
| <TooltipProvider> | ||
| <TooltipRoot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: N8nTooltip drops all consumer attributes/listeners because $attrs is no longer forwarded while inheritAttrs: false is still set. Forward $attrs to TooltipRoot so props like append-to, trigger, and custom classes keep working.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/frontend/@n8n/design-system/src/components/N8nTooltip/Tooltip.vue, line 78:
<comment>`N8nTooltip` drops all consumer attributes/listeners because `$attrs` is no longer forwarded while `inheritAttrs: false` is still set. Forward `$attrs` to `TooltipRoot` so props like `append-to`, `trigger`, and custom classes keep working.</comment>
<file context>
@@ -1,77 +1,173 @@
- :class="$style.buttons"
- :style="{ justifyContent: props.justifyButtons }"
+ <TooltipProvider>
+ <TooltipRoot
+ :disabled="disabled"
+ :delay-duration="showAfter"
</file context>
| <TooltipRoot | |
| <TooltipRoot | |
| v-bind="$attrs" |
| expect(document.querySelector('[data-dismissable-layer]')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| const button = document.querySelector('[data-dismissable-layer] button'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The buttons test no longer verifies that the provided click listeners fire—buttonSpy is never exercised—so the test can’t catch regressions where button clicks stop working. Add a userEvent.click and assert the spy was called to cover the behavior.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/frontend/@n8n/design-system/src/components/N8nTooltip/Tooltip.test.ts, line 355:
<comment>The `buttons` test no longer verifies that the provided click listeners fire—`buttonSpy` is never exercised—so the test can’t catch regressions where button clicks stop working. Add a `userEvent.click` and assert the spy was called to cover the behavior.</comment>
<file context>
@@ -1,40 +1,474 @@
+ expect(document.querySelector('[data-dismissable-layer]')).toBeInTheDocument();
+ });
+
+ const button = document.querySelector('[data-dismissable-layer] button');
+ expect(button).toBeInTheDocument();
+ expect(button).toHaveTextContent('Button 1');
</file context>
| const button = document.querySelector('[data-dismissable-layer] button'); | |
| const button = document.querySelector('[data-dismissable-layer] button') as HTMLElement; | |
| expect(button).toBeInTheDocument(); | |
| expect(button).toHaveTextContent('Button 1'); | |
| await userEvent.click(button); | |
| expect(buttonSpy).toHaveBeenCalled(); |
|
|
||
| it('shows binary data tooltip content only on disabled button hover', async () => { | ||
| const { getByRole, queryByRole, emitted } = renderComponent({ | ||
| const { getByRole, emitted, baseElement } = renderComponent({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: This test also lost its pre-hover absence check, so it no longer verifies that the binary tooltip only appears after hovering the disabled button. Add a DOM assertion before the hover to keep the test aligned with its purpose.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/frontend/editor-ui/src/features/ndv/runData/components/RunDataPinButton.test.ts, line 58:
<comment>This test also lost its pre-hover absence check, so it no longer verifies that the binary tooltip only appears after hovering the disabled button. Add a DOM assertion before the hover to keep the test aligned with its purpose.</comment>
<file context>
@@ -40,22 +40,22 @@ describe('RunDataPinButton.vue', () => {
it('shows binary data tooltip content only on disabled button hover', async () => {
- const { getByRole, queryByRole, emitted } = renderComponent({
+ const { getByRole, emitted, baseElement } = renderComponent({
props: {
tooltipContentsVisibility: {
</file context>
| const { getByRole, emitted, baseElement } = renderComponent({ | |
| const { getByRole, emitted, baseElement } = renderComponent({ | |
| props: { | |
| tooltipContentsVisibility: { | |
| binaryDataTooltipContent: true, | |
| pinDataDiscoveryTooltipContent: false, | |
| }, | |
| disabled: true, | |
| }, | |
| }); | |
| expect(baseElement.ownerDocument.querySelector('[data-dismissable-layer]')).not.toBeInTheDocument(); |
| const { getByRole, queryByRole, emitted } = renderComponent(); | ||
|
|
||
| expect(queryByRole('tooltip')).not.toBeInTheDocument(); | ||
| const { getByRole, emitted, baseElement } = renderComponent(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: This test no longer checks that the tooltip is absent before hovering, so a regression where the tooltip renders immediately would go undetected. Add an assertion that no [data-dismissable-layer] exists prior to userEvent.hover to keep the “only on hover” contract under test.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/frontend/editor-ui/src/features/ndv/runData/components/RunDataPinButton.test.ts, line 43:
<comment>This test no longer checks that the tooltip is absent before hovering, so a regression where the tooltip renders immediately would go undetected. Add an assertion that no `[data-dismissable-layer]` exists prior to `userEvent.hover` to keep the “only on hover” contract under test.</comment>
<file context>
@@ -40,22 +40,22 @@ describe('RunDataPinButton.vue', () => {
- const { getByRole, queryByRole, emitted } = renderComponent();
-
- expect(queryByRole('tooltip')).not.toBeInTheDocument();
+ const { getByRole, emitted, baseElement } = renderComponent();
expect(getByRole('button')).toBeEnabled();
</file context>
| const { getByRole, emitted, baseElement } = renderComponent(); | |
| const { getByRole, emitted, baseElement } = renderComponent(); | |
| expect(baseElement.ownerDocument.querySelector('[data-dismissable-layer]')).not.toBeInTheDocument(); |
| return { tooltip }; | ||
| } | ||
|
|
||
| describe('v2/components/Tooltip', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: Rule violated: Tests
Removing the entire Tooltip test suite violates the Community PR Guidelines §2 testing requirement—core Tooltip behavior now lacks any automated coverage after the refactor. Please replace the deleted tests with equivalent coverage for the new tooltip implementation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/frontend/@n8n/design-system/src/v2/components/Tooltip/Tooltip.test.ts, line 17:
<comment>Removing the entire Tooltip test suite violates the Community PR Guidelines §2 testing requirement—core Tooltip behavior now lacks any automated coverage after the refactor. Please replace the deleted tests with equivalent coverage for the new tooltip implementation.</comment>
<file context>
@@ -1,384 +0,0 @@
-import userEvent from '@testing-library/user-event';
-import { render, waitFor } from '@testing-library/vue';
-
-import Tooltip from './Tooltip.vue';
-
-async function getTooltipContent(_trigger?: Element | null) {
- const tooltip = await waitFor(() => {
- // Reka UI tooltip content has data-dismissable-layer attribute
- const el = document.querySelector('[data-dismissable-layer]');
</file context>
Summary
Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)