Skip to content

Commit 349f6ff

Browse files
CopilotRaubzeug
andcommitted
fix: correct typo in variable name and simplify e2e test navigation
Co-authored-by: Raubzeug <[email protected]>
1 parent 48eecc9 commit 349f6ff

File tree

2 files changed

+14
-68
lines changed

2 files changed

+14
-68
lines changed

src/containers/Node/Node.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,21 @@ export function Node() {
6969
const isStorageNode = node?.Roles?.find((el) => el === STORAGE_ROLE);
7070

7171
const {activeTab, nodeTabs} = React.useMemo(() => {
72-
let actulaNodeTabs = isStorageNode
72+
let actualNodeTabs = isStorageNode
7373
? NODE_TABS
7474
: NODE_TABS.filter((el) => el.id !== 'storage');
7575
if (isDiskPagesAvailable) {
76-
actulaNodeTabs = actulaNodeTabs.filter((el) => el.id !== 'structure');
76+
actualNodeTabs = actualNodeTabs.filter((el) => el.id !== 'structure');
7777
}
7878
// Filter out threads tab if there's no thread data in the API response
7979
if (!node?.Threads || node.Threads.length === 0) {
80-
actulaNodeTabs = actulaNodeTabs.filter((el) => el.id !== 'threads');
80+
actualNodeTabs = actualNodeTabs.filter((el) => el.id !== 'threads');
8181
}
8282

8383
const actualActiveTab =
84-
actulaNodeTabs.find(({id}) => id === activeTabId) ?? actulaNodeTabs[0];
84+
actualNodeTabs.find(({id}) => id === activeTabId) ?? actualNodeTabs[0];
8585

86-
return {activeTab: actualActiveTab, nodeTabs: actulaNodeTabs};
86+
return {activeTab: actualActiveTab, nodeTabs: actualNodeTabs};
8787
}, [isStorageNode, isDiskPagesAvailable, activeTabId, node?.Threads]);
8888

8989
const tenantName = node?.Tenants?.[0] || tenantNameFromQuery?.toString();

tests/suites/nodes/nodes.test.ts

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -214,27 +214,9 @@ test.describe('Test Node Page Threads Tab', async () => {
214214
});
215215
});
216216

217-
const nodesPage = new NodesPage(page);
218-
await nodesPage.goto();
219-
220-
// Get first node ID to navigate to
221-
const paginatedTable = new ClusterNodesTable(page);
222-
await paginatedTable.waitForTableToLoad();
223-
await paginatedTable.waitForTableData();
224-
225-
// Click on first node to navigate to node page
226-
const firstRowLink = page
227-
.locator('.ydb-paginated-table__table tbody tr:first-child a')
228-
.first();
229-
await firstRowLink.click();
230-
231-
// Wait for navigation to complete
232-
await page.waitForURL(/\/node\/\d+/);
233-
234-
const nodeId = await page.url().match(/\/node\/(\d+)/)?.[1];
235-
expect(nodeId).toBeDefined();
236-
237-
const nodePage = new NodePage(page, nodeId!);
217+
// Navigate directly to node page
218+
const nodePage = new NodePage(page, '1');
219+
await nodePage.goto();
238220
await nodePage.waitForNodePageLoad();
239221

240222
// Verify threads tab is not visible
@@ -270,27 +252,9 @@ test.describe('Test Node Page Threads Tab', async () => {
270252
});
271253
});
272254

273-
const nodesPage = new NodesPage(page);
274-
await nodesPage.goto();
275-
276-
// Get first node ID to navigate to
277-
const paginatedTable = new ClusterNodesTable(page);
278-
await paginatedTable.waitForTableToLoad();
279-
await paginatedTable.waitForTableData();
280-
281-
// Click on first node to navigate to node page
282-
const firstRowLink = page
283-
.locator('.ydb-paginated-table__table tbody tr:first-child a')
284-
.first();
285-
await firstRowLink.click();
286-
287-
// Wait for navigation to complete
288-
await page.waitForURL(/\/node\/\d+/);
289-
290-
const nodeId = await page.url().match(/\/node\/(\d+)/)?.[1];
291-
expect(nodeId).toBeDefined();
292-
293-
const nodePage = new NodePage(page, nodeId!);
255+
// Navigate directly to node page
256+
const nodePage = new NodePage(page, '1');
257+
await nodePage.goto();
294258
await nodePage.waitForNodePageLoad();
295259

296260
// Verify threads tab is visible
@@ -325,27 +289,9 @@ test.describe('Test Node Page Threads Tab', async () => {
325289
});
326290
});
327291

328-
const nodesPage = new NodesPage(page);
329-
await nodesPage.goto();
330-
331-
// Get first node ID to navigate to
332-
const paginatedTable = new ClusterNodesTable(page);
333-
await paginatedTable.waitForTableToLoad();
334-
await paginatedTable.waitForTableData();
335-
336-
// Click on first node to navigate to node page
337-
const firstRowLink = page
338-
.locator('.ydb-paginated-table__table tbody tr:first-child a')
339-
.first();
340-
await firstRowLink.click();
341-
342-
// Wait for navigation to complete
343-
await page.waitForURL(/\/node\/\d+/);
344-
345-
const nodeId = await page.url().match(/\/node\/(\d+)/)?.[1];
346-
expect(nodeId).toBeDefined();
347-
348-
const nodePage = new NodePage(page, nodeId!);
292+
// Navigate directly to node page
293+
const nodePage = new NodePage(page, '1');
294+
await nodePage.goto();
349295
await nodePage.waitForNodePageLoad();
350296

351297
// Verify threads tab is not visible

0 commit comments

Comments
 (0)