Skip to content

Commit 469ab9a

Browse files
committed
chore: collapse expand tests
1 parent 38c88e5 commit 469ab9a

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

src/containers/Tenant/utils/paneVisibilityToggleHelpers.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export function PaneVisibilityToggleButtons({
8686
<React.Fragment>
8787
<ActionTooltip title="Collapse">
8888
<Button
89+
title="Collapse"
8990
view="flat-secondary"
9091
onClick={onCollapse}
9192
className={b(
@@ -101,6 +102,7 @@ export function PaneVisibilityToggleButtons({
101102

102103
<ActionTooltip title="Expand">
103104
<Button
105+
title="Expand"
104106
view="flat-secondary"
105107
onClick={onExpand}
106108
className={b(

tests/suites/tenant/summary/ObjectSummary.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export class ObjectSummary {
2424
private createDirectoryInput: Locator;
2525
private createDirectoryButton: Locator;
2626
private refreshButton: Locator;
27+
private infoCollapseButton: Locator;
28+
private infoExpandButton: Locator;
29+
private summaryCollapseButton: Locator;
30+
private summaryExpandButton: Locator;
2731

2832
constructor(page: Page) {
2933
this.tree = page.locator('.ydb-object-summary__tree');
@@ -41,6 +45,33 @@ export class ObjectSummary {
4145
);
4246
this.createDirectoryButton = page.locator('button.g-button_view_action:has-text("Create")');
4347
this.refreshButton = page.locator('.ydb-object-summary__refresh-button');
48+
49+
// Info panel collapse/expand buttons
50+
this.infoCollapseButton = page.locator(
51+
'.ydb-object-summary__info-controls button[title="Collapse"]',
52+
);
53+
this.infoExpandButton = page.locator(
54+
'.ydb-object-summary__info-controls button[title="Expand"]',
55+
);
56+
this.summaryCollapseButton = page.locator(
57+
'.ydb-object-summary__actions button[title="Collapse"]',
58+
);
59+
this.summaryExpandButton = page.locator(
60+
'.ydb-object-summary__actions button[title="Expand"]',
61+
);
62+
}
63+
64+
async collapseInfoPanel(): Promise<void> {
65+
await this.infoCollapseButton.click();
66+
}
67+
68+
async expandInfoPanel(): Promise<void> {
69+
await this.infoExpandButton.click();
70+
}
71+
72+
async isInfoPanelCollapsed(): Promise<boolean> {
73+
// When panel is collapsed, expand button should be visible
74+
return this.infoExpandButton.isVisible();
4475
}
4576

4677
async isCreateDirectoryModalVisible(): Promise<boolean> {
@@ -201,4 +232,17 @@ export class ObjectSummary {
201232
async clickRefreshButton(): Promise<void> {
202233
await this.refreshButton.click();
203234
}
235+
236+
async collapseSummary(): Promise<void> {
237+
await this.summaryCollapseButton.click();
238+
}
239+
240+
async expandSummary(): Promise<void> {
241+
await this.summaryExpandButton.click();
242+
}
243+
244+
async isSummaryCollapsed(): Promise<boolean> {
245+
// When summary is collapsed, expand button should be visible
246+
return this.summaryExpandButton.isVisible();
247+
}
204248
}

tests/suites/tenant/summary/objectSummary.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,4 +285,28 @@ test.describe('Object Summary', async () => {
285285
const treeItemAfterRefresh = page.locator('.ydb-tree-view').filter({hasText: tableName});
286286
await expect(treeItemAfterRefresh).toBeVisible();
287287
});
288+
289+
test('Info panel collapse and expand functionality', async ({page}) => {
290+
const objectSummary = new ObjectSummary(page);
291+
await expect(objectSummary.isTreeVisible()).resolves.toBe(true);
292+
293+
// Test info panel collapse/expand
294+
await objectSummary.collapseInfoPanel();
295+
await expect(objectSummary.isInfoPanelCollapsed()).resolves.toBe(true);
296+
297+
await objectSummary.expandInfoPanel();
298+
await expect(objectSummary.isInfoPanelCollapsed()).resolves.toBe(false);
299+
});
300+
301+
test('Summary collapse and expand functionality', async ({page}) => {
302+
const objectSummary = new ObjectSummary(page);
303+
await expect(objectSummary.isTreeVisible()).resolves.toBe(true);
304+
305+
// Test summary collapse/expand
306+
await objectSummary.collapseSummary();
307+
await expect(objectSummary.isSummaryCollapsed()).resolves.toBe(true);
308+
309+
await objectSummary.expandSummary();
310+
await expect(objectSummary.isSummaryCollapsed()).resolves.toBe(false);
311+
});
288312
});

0 commit comments

Comments
 (0)