Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/manage-versions-react",
"comment": "Fix flaky test",
"type": "none"
}
],
"packageName": "@itwin/manage-versions-react"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
9 changes: 9 additions & 0 deletions packages/modules/manage-versions/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.test.json",
"compilerOptions": {
"noEmit": true,
"types": ["jest"],
"module": "nodenext"
},
"include": ["./**/*.test.ts", "./**/*.test.tsx", "./**/*.d.ts"]
}
1 change: 1 addition & 0 deletions packages/modules/manage-versions/tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
"**/*.js*",
"**/.*.js*"
],
"exclude": ["cjs/**/*", "esm/**/*"]
}
11 changes: 11 additions & 0 deletions packages/modules/manage-versions/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "nodenext",
"types": ["jest", "node"],
"rootDir": "./src",
"outDir": "./esm"
},
"include": ["./src/**/*.ts*"]
}
Loading