Skip to content

Commit a140b42

Browse files
test: stabilize disk palette and table scrolling checks
1 parent e7d9b3d commit a140b42

18 files changed

Lines changed: 26 additions & 15 deletions

‎tests/suites/nodes/pdisksPreview.test.ts‎

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import {setupPDiskPreviewMocks} from './pdisksPreviewMocks';
1515

1616
const settingTitle = 'Compact PDisk previews';
1717
const previewSelector = '.ydb-storage-pdisks-preview__control';
18+
// Linux ARM64 and x64 round translucent disk colors differently by 1–2 RGB levels.
19+
// Keep exact palette comparisons against a baseline from the same architecture.
20+
const paletteArchitecture = process.platform === 'linux' ? `-${process.arch}` : '';
1821

1922
async function openNodeDisks(page: Page) {
2023
await new NodesPage(page).goto({clusterName: 'preview-test', backend: 'https://preview.test'});
@@ -84,11 +87,14 @@ for (const theme of ['light', 'dark']) {
8487
};
8588
// Keep previews and their original controls together in the same reference image.
8689
// Tiny translucent squares need exact comparison to catch missing color layers.
87-
await expect(page).toHaveScreenshot(`pdisk-preview-palette-${theme}.png`, {
88-
clip,
89-
threshold: 0,
90-
maxDiffPixels: 0,
91-
});
90+
await expect(page).toHaveScreenshot(
91+
`pdisk-preview-palette-${theme}${paletteArchitecture}.png`,
92+
{
93+
clip,
94+
threshold: 0,
95+
maxDiffPixels: 0,
96+
},
97+
);
9298

9399
// As in vdiskColoring.test.ts, force every tone's hover state for one stable snapshot.
94100
await previews.locator('.ydb-storage-pdisks-preview__color').evaluateAll((elements) => {
@@ -101,11 +107,14 @@ for (const theme of ['light', 'dark']) {
101107
element.classList.add('storage-disk-progress-bar_highlighted'),
102108
);
103109
});
104-
await expect(page).toHaveScreenshot(`pdisk-preview-palette-${theme}-hover.png`, {
105-
clip,
106-
threshold: 0,
107-
maxDiffPixels: 0,
108-
});
110+
await expect(page).toHaveScreenshot(
111+
`pdisk-preview-palette-${theme}-hover${paletteArchitecture}.png`,
112+
{
113+
clip,
114+
threshold: 0,
115+
maxDiffPixels: 0,
116+
},
117+
);
109118
});
110119
}
111120

tests/suites/nodes/pdisksPreview.test.ts-snapshots/pdisk-preview-palette-dark-chromium-linux.png renamed to tests/suites/nodes/pdisksPreview.test.ts-snapshots/pdisk-preview-palette-dark-arm64-chromium-linux.png

File renamed without changes.

tests/suites/nodes/pdisksPreview.test.ts-snapshots/pdisk-preview-palette-dark-safari-linux.png renamed to tests/suites/nodes/pdisksPreview.test.ts-snapshots/pdisk-preview-palette-dark-arm64-safari-linux.png

File renamed without changes.

tests/suites/nodes/pdisksPreview.test.ts-snapshots/pdisk-preview-palette-dark-hover-chromium-linux.png renamed to tests/suites/nodes/pdisksPreview.test.ts-snapshots/pdisk-preview-palette-dark-hover-arm64-chromium-linux.png

File renamed without changes.

tests/suites/nodes/pdisksPreview.test.ts-snapshots/pdisk-preview-palette-dark-hover-safari-linux.png renamed to tests/suites/nodes/pdisksPreview.test.ts-snapshots/pdisk-preview-palette-dark-hover-arm64-safari-linux.png

File renamed without changes.
5.25 KB
Loading
6.66 KB
Loading
4.89 KB
Loading
6.43 KB
Loading

tests/suites/nodes/pdisksPreview.test.ts-snapshots/pdisk-preview-palette-light-chromium-linux.png renamed to tests/suites/nodes/pdisksPreview.test.ts-snapshots/pdisk-preview-palette-light-arm64-chromium-linux.png

File renamed without changes.

0 commit comments

Comments
 (0)