From 4c89542506543f4b04a0e8974b49c9acc8a92dd9 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 20 Oct 2026 05:12:01 +0000 Subject: [PATCH 1/3] test(app-shell): wait for the counted backfill checkbox in the unchecked publish case (objectui#13120) The unchecked case read the backfill checkbox by its counted name (N) synchronously right after openSheet(). openSheet() resolves once the option is drawn, but the drill-in asks the adapter for the record count only after that render, so on a slow runner the name had no number yet and getByRole missed it. The read now waits (findByRole), like the two cases above it; the name still has to carry N. Claude-Session: https://claude.ai/code/session_014MXhk1yjWh37d634hLy3p7 Co-authored-by: Claude --- ...tudioDesignSurface.publishBackfill-12929.test.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/app-shell/src/views/studio-design/StudioDesignSurface.publishBackfill-12929.test.tsx b/packages/app-shell/src/views/studio-design/StudioDesignSurface.publishBackfill-12929.test.tsx index 26173cdd0d..acbed1bd0d 100644 --- a/packages/app-shell/src/views/studio-design/StudioDesignSurface.publishBackfill-12929.test.tsx +++ b/packages/app-shell/src/views/studio-design/StudioDesignSurface.publishBackfill-12929.test.tsx @@ -160,7 +160,14 @@ afterEach(() => { vi.unstubAllGlobals(); }); -/** Open the sheet the way the author does: the header's Publish, which opens it to confirm. */ +/** + * Open the sheet the way the author does: the header's Publish, which opens it to confirm. + * + * Resolves once the backfill option is drawn, NOT once its count is: the drill-in + * asks the adapter for the record count only after the option renders, and names + * no number until that read lands. A read of the counted name (N) is therefore a + * waiting `findByRole`, never a synchronous `getByRole`, which races the count. + */ async function openSheet(): Promise { render( @@ -228,7 +235,8 @@ describe('Studio publish with the default backfill (objectui#12929)', () => { it('unchecked: the publish names no field, so nothing is written into existing rows', async () => { const sheet = await openSheet(); - expect(within(sheet).getByRole('checkbox', { name: new RegExp(`\\b${N}\\b`) })).not.toBeChecked(); + // Waited for, like the cases above: the count lands after the option draws. + expect(await within(sheet).findByRole('checkbox', { name: new RegExp(`\\b${N}\\b`) })).not.toBeChecked(); fireEvent.click(within(sheet).getByTestId('draft-changes-publish')); From b354a8ec8156b985ad98a6be99e859d3ec4c0f7a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 20 Oct 2026 05:15:57 +0000 Subject: [PATCH 2/3] chore(changeset): declare the backfill test wait as releasing nothing (objectui#13120) check-changeset-presence counts any file under a released package's src/ as published source, the test file included, so the test-only change declares an empty-frontmatter changeset. Claude-Session: https://claude.ai/code/session_014MXhk1yjWh37d634hLy3p7 Co-authored-by: Claude --- .changeset/13120-backfill-checkbox-wait.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changeset/13120-backfill-checkbox-wait.md diff --git a/.changeset/13120-backfill-checkbox-wait.md b/.changeset/13120-backfill-checkbox-wait.md new file mode 100644 index 0000000000..874be67606 --- /dev/null +++ b/.changeset/13120-backfill-checkbox-wait.md @@ -0,0 +1,4 @@ +--- +--- + +No package released: test only. `@object-ui/app-shell`'s Studio publish-backfill test now waits for the backfill checkbox's counted name in its unchecked case, as its other two cases already did. The drill-in reads the record count after the option renders, so a synchronous read raced that count on a slow runner (objectui#13120). No source, export, type or behaviour changes. From 05dc4638ac62824c2e69ae0123013b54fe1e3083 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 20 Oct 2026 05:44:19 +0000 Subject: [PATCH 3/3] test(app-shell): wait for the counted backfill checkbox in the sheet's one-choice case (objectui#13120) DraftChangesPanel.backfill-12929's "one choice" case read the checkbox by its counted name ('Backfill default (12 existing records)') synchronously after the option was found. The drill-in asks the adapter for the count only after the option renders, so the name could still carry no number; the read now waits (findByRole) with the exact same name. The empty changeset's text names both test files. Claude-Session: https://claude.ai/code/session_014MXhk1yjWh37d634hLy3p7 Co-authored-by: Claude --- .changeset/13120-backfill-checkbox-wait.md | 2 +- .../__tests__/DraftChangesPanel.backfill-12929.test.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.changeset/13120-backfill-checkbox-wait.md b/.changeset/13120-backfill-checkbox-wait.md index 874be67606..4010b9fde4 100644 --- a/.changeset/13120-backfill-checkbox-wait.md +++ b/.changeset/13120-backfill-checkbox-wait.md @@ -1,4 +1,4 @@ --- --- -No package released: test only. `@object-ui/app-shell`'s Studio publish-backfill test now waits for the backfill checkbox's counted name in its unchecked case, as its other two cases already did. The drill-in reads the record count after the option renders, so a synchronous read raced that count on a slow runner (objectui#13120). No source, export, type or behaviour changes. +No package released: test only. Two `@object-ui/app-shell` backfill tests now wait for the backfill checkbox's counted name instead of reading it synchronously: the Studio publish-backfill test's unchecked case (as its other two cases already did), and the pending-changes sheet's "one choice" case. The drill-in reads the record count after the option renders, so a synchronous read raced that count on a slow runner (objectui#13120). No source, export, type or behaviour changes. diff --git a/packages/app-shell/src/preview/__tests__/DraftChangesPanel.backfill-12929.test.tsx b/packages/app-shell/src/preview/__tests__/DraftChangesPanel.backfill-12929.test.tsx index 85736c24e6..c8502f90ff 100644 --- a/packages/app-shell/src/preview/__tests__/DraftChangesPanel.backfill-12929.test.tsx +++ b/packages/app-shell/src/preview/__tests__/DraftChangesPanel.backfill-12929.test.tsx @@ -114,7 +114,9 @@ describe('the backfill choice is offered only where the batch door would honour await settled(); const options = await screen.findAllByTestId('draft-backfill-option'); expect(options).toHaveLength(1); - const box = screen.getByRole('checkbox', { name: 'Backfill default (12 existing records)' }); + // Waited for: the drill-in reads the count only after the option draws, so the + // name carries no number until that read lands. + const box = await screen.findByRole('checkbox', { name: 'Backfill default (12 existing records)' }); expect(box).not.toBeChecked(); // The literal the door would write is shown beside it. expect(options[0]).toHaveTextContent('= false');