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()}`); }