From 8a85764cf1839a14e36a15d576b7b58a8bcc34e9 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste WATENBERG Date: Fri, 3 Jan 2025 10:50:32 +0100 Subject: [PATCH] Fix nodelist.spec.js --- ui/cypress/integration/node/nodelist.spec.js | 5 +++++ ui/src/components/NodeListTable.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/cypress/integration/node/nodelist.spec.js b/ui/cypress/integration/node/nodelist.spec.js index 604b6ff24b..ffe0eeb7ae 100644 --- a/ui/cypress/integration/node/nodelist.spec.js +++ b/ui/cypress/integration/node/nodelist.spec.js @@ -39,6 +39,11 @@ describe('Node list', () => { cy.visit('/nodes'); cy.stubHistory(); + cy.fixture('kubernetes/nodes.json').then((nodes) => { + // With sorting implemented, node "test" is in unknown state hence should be the first on the nodelist. + cy.location('pathname').should('eq', `/nodes/test/overview`); + }); + cy.get('[data-cy="create_node_button"]').click(); cy.url().should('include', '/nodes/create'); }); diff --git a/ui/src/components/NodeListTable.tsx b/ui/src/components/NodeListTable.tsx index 2862f3939c..6f94ce146f 100644 --- a/ui/src/components/NodeListTable.tsx +++ b/ui/src/components/NodeListTable.tsx @@ -137,7 +137,7 @@ const NodeListTable = ({ nodeTableData }) => { `/nodes/${nodeName}/`, ); if (isTabSelected) { - navigate(newPath); + navigate(`${newPath}?${query.toString()}`); } else { navigate(`${newPath}/overview?${query.toString()}`); }