Skip to content

Commit

Permalink
fix(editor): Don't render pinned icon for disabled nodes (#10712)
Browse files Browse the repository at this point in the history
  • Loading branch information
r00gm authored Sep 6, 2024
1 parent 43713dc commit 879b837
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ describe('CanvasNodeStatusIcons', () => {
expect(getByTestId('canvas-node-status-pinned')).toBeInTheDocument();
});

it('should not render pinned icon when disabled', () => {
const { queryByTestId } = renderComponent({
global: {
provide: createCanvasNodeProvide({
data: { disabled: true, pinnedData: { count: 5, visible: true } },
}),
},
});

expect(queryByTestId('canvas-node-status-pinned')).not.toBeInTheDocument();
});

it('should render correctly for a running node', () => {
const { getByTestId } = renderComponent({
global: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const {
executionRunning,
hasRunData,
runDataIterations,
isDisabled,
} = useCanvasNode();
const hideNodeIssues = computed(() => false); // @TODO Implement this
Expand Down Expand Up @@ -45,7 +46,7 @@ const hideNodeIssues = computed(() => false); // @TODO Implement this
</N8nTooltip>
</div>
<div
v-else-if="hasPinnedData && !nodeHelpers.isProductionExecutionPreview.value"
v-else-if="hasPinnedData && !nodeHelpers.isProductionExecutionPreview.value && !isDisabled"
data-test-id="canvas-node-status-pinned"
:class="[$style.status, $style.pinnedData]"
>
Expand Down

0 comments on commit 879b837

Please sign in to comment.