diff --git a/common/changes/@itwin/manage-versions-react/omar-manage-versions-eslint-fix_2026-09-02-19-32.json b/common/changes/@itwin/manage-versions-react/omar-manage-versions-eslint-fix_2026-09-02-19-32.json new file mode 100644 index 00000000..58093295 --- /dev/null +++ b/common/changes/@itwin/manage-versions-react/omar-manage-versions-eslint-fix_2026-09-02-19-32.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/manage-versions-react", + "comment": "Fix flaky test", + "type": "none" + } + ], + "packageName": "@itwin/manage-versions-react" +} \ No newline at end of file diff --git a/packages/modules/manage-versions/src/components/ManageVersions/ManageVersions.test.tsx b/packages/modules/manage-versions/src/components/ManageVersions/ManageVersions.test.tsx index 90a82051..28ae8d70 100644 --- a/packages/modules/manage-versions/src/components/ManageVersions/ManageVersions.test.tsx +++ b/packages/modules/manage-versions/src/components/ManageVersions/ManageVersions.test.tsx @@ -71,14 +71,19 @@ describe("ManageVersions", () => { it("should show versions table with data", async () => { const { container } = renderComponent(); - await waitFor(() => - expect(container.querySelector(".iac-versions-table-body")).toBeVisible() - ); + // Wait for at least one virtualized row to actually be mounted, not just + // for the table body wrapper to appear. The virtualizer measures the + // container and mounts visible rows in a later render pass, so asserting + // on the wrapper alone is a race that can flake on slower CI runners. + await waitFor(() => { + const rows = container.querySelectorAll( + ".iac-versions-table-body [role='row']" + ); + expect(rows.length).toBeGreaterThanOrEqual(1); + }); const versionRows = container.querySelectorAll( ".iac-versions-table-body [role='row']" ); - // Virtualization renders only visible rows - expect(versionRows.length).toBeGreaterThanOrEqual(1); // Check that at least the first visible row has the expected structure const firstRow = versionRows[0]; diff --git a/packages/modules/manage-versions/src/tsconfig.json b/packages/modules/manage-versions/src/tsconfig.json new file mode 100644 index 00000000..7f998bc8 --- /dev/null +++ b/packages/modules/manage-versions/src/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../tsconfig.test.json", + "compilerOptions": { + "noEmit": true, + "types": ["jest"], + "module": "nodenext" + }, + "include": ["./**/*.test.ts", "./**/*.test.tsx", "./**/*.d.ts"] +} \ No newline at end of file diff --git a/packages/modules/manage-versions/tsconfig.eslint.json b/packages/modules/manage-versions/tsconfig.eslint.json index b936dace..38f6b814 100644 --- a/packages/modules/manage-versions/tsconfig.eslint.json +++ b/packages/modules/manage-versions/tsconfig.eslint.json @@ -5,4 +5,5 @@ "**/*.js*", "**/.*.js*" ], + "exclude": ["cjs/**/*", "esm/**/*"] } \ No newline at end of file diff --git a/packages/modules/manage-versions/tsconfig.test.json b/packages/modules/manage-versions/tsconfig.test.json new file mode 100644 index 00000000..53cf389a --- /dev/null +++ b/packages/modules/manage-versions/tsconfig.test.json @@ -0,0 +1,11 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "CommonJS", + "moduleResolution": "nodenext", + "types": ["jest", "node"], + "rootDir": "./src", + "outDir": "./esm" + }, + "include": ["./src/**/*.ts*"] +}