Skip to content

Commit

Permalink
Fix node tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JBWatenbergScality committed Jan 3, 2025
1 parent 8a85764 commit 874fd64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ui/cypress/integration/node/nodetabs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ describe('Node page volumes tabs', () => {
it('brings me to the loki-vol volume page', () => {
cy.stubHistory();

cy.findByRole('gridcell', { name: /loki-vol/i }).click();
cy.findByRole('gridcell', { name: /loki-vol/i });

cy.findByText(/loki-vol/i).click({ force: true });
cy.url().should('include', '/volumes/loki-vol/overview');
});

Expand Down
6 changes: 5 additions & 1 deletion ui/src/containers/NodePageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ const NodePageContent = (props) => {
useEffect(() => {
if (nodeTableData.length > 0) {
const firstNodeName = nodeTableData[0]?.name?.name;
if (firstNodeName && !path.includes(firstNodeName)) {
if (
firstNodeName &&
!path.includes(firstNodeName) &&
path.endsWith('/nodes')
) {
navigate(`/nodes/${firstNodeName}/overview`, { replace: true });
}
} // eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down

0 comments on commit 874fd64

Please sign in to comment.