Repository navigation
test: fix month-boundary and Sonner mount races in StatusEditor and RelayStaff tests - #2064
Merged
Merged
Conversation
…month end Signed-off-by: Kalvin Chau <kalvin@block.xyz>
matt2e
approved these changes
Oct 31, 2026
…ility Signed-off-by: Kalvin Chau <kalvin@block.xyz>
shellz-n-stuff
added a commit
that referenced
this pull request
Oct 31, 2026
Picks up the month-boundary StatusEditor test fix (#2064). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * origin/main: (56 commits) perf(sidebar): subscribe to selected live and list facts (#1966) feat(desktop): align the sign-in callback page with web branding (#2038) Show linked PRs in Solo headers and move idle huddles to Chat actions (#1968) feat(messages): mark edited messages with "(edited)" (#2020) feat(desktop): bundle the buzz CLI in every package (#2027) feat(plugins): open a plugin page from buzz://plugin links (#2053) feat(plugins): managed plugin sources (#2052) test(browser): prevent sampled clock pause races (#1955) test: fix month-boundary and Sonner mount races in StatusEditor and RelayStaff tests (#2064) test: stop tests leaving temp dirs and a flake-check fixture behind (#1977) fix(messages): release Virtua's held range when scrolling stops (#2032) test(mcp): allow protection checks in bundled help fixture (#2061) fix(emoji): recover transient image failures without reopening chats (#2000) test: wait for dialog focus, reach a reading position, re-sign pair() (#1975) feat(plugins): sign builderlab in through the native fi session in fi builds (#1461) feat(agents): offer bundled Buzz help (#2033) fix(github): show pull request status for anchors and subpages (#2055) fix(dialogs): focus safe controls and task inputs (#2021) fix(composer): truncate workspace names at narrow widths (#2043) AIDA-2287: Refresh public channel search incrementally (#2023) ... Signed-off-by: Alex Rosenzweig <arosenzweig@squareup.com>
morgmart
added a commit
that referenced
this pull request
Oct 31, 2026
…isibility * origin/main: (23 commits) feat(profiles): show NIP-FI verified names (BUZZ-433) (#2005) feat(identity): sign in to the organization when Buzz opens (#2086) perf(identity-names): stop rerunning name policy for live member churn (#2092) fix(sidebar): keep the channel drag preview under the pointer (#2019) fix(identity): use xyz.block.buzz.desktop federated-session keychain service (#2094) perf(relay): read each channel's remote access once per accepted batch (#2091) fix(styles): keep page status :has() on each rule's subject (#2081) fix(navigation): show a notice for invalid deep links (#2054) fix(messages): preserve held readers through equal-height resizes (#1963) perf(sidebar): subscribe to selected live and list facts (#1966) feat(desktop): align the sign-in callback page with web branding (#2038) Show linked PRs in Solo headers and move idle huddles to Chat actions (#1968) feat(messages): mark edited messages with "(edited)" (#2020) feat(desktop): bundle the buzz CLI in every package (#2027) feat(plugins): open a plugin page from buzz://plugin links (#2053) feat(plugins): managed plugin sources (#2052) test(browser): prevent sampled clock pause races (#1955) test: fix month-boundary and Sonner mount races in StatusEditor and RelayStaff tests (#2064) test: stop tests leaving temp dirs and a flake-check fixture behind (#1977) fix(messages): release Virtua's held range when scrolling stops (#2032) ... # Conflicts: # src/bundled/channels/ChannelMemberAvatars.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two timing-dependent Vitest failures, one on
mainand one seen on this PR's CI. Both changes are test-only; product code is unchanged.StatusEditor.test.tsx› prefills and preserves an existing deadline…Unable to find role="button" and name /^Today,/(main run)RelayStaff.test.tsx› enforcement error finished while closed reaches reopened detailexpect(element).toBeVisible()on.buzz-toast-title(PR run)1.
StatusEditor: month-boundary clock dependencyRoot cause. The test seeds an existing status with
expiresAt = Date.now() + 86400. The custom date picker opens on the month of the prefilled deadline, and the test then clicks theToday, …day button. On the last day of a month (in the runner's time zone), tomorrow is in the next month. The calendar then renders that month, today's button isn't present, andfindByRoletimes out. CI ran at2026-10-31T00:28Z.Opening on the month of the selected date is intended product behavior.
Fix.
vi.useFakeTimers({ toFake: ["Date"], now: new Date(2026, 5, 15, 12) })pinsDateto a mid-month local noon, sonow + 1 daystays in the same month in any time zone.Dateis faked. Timers, microtasks anduser-eventscheduling stay real, so the existingwaitFor/findBy*behavior doesn't change.afterEachcallsvi.useRealTimers()so other tests in the file go back to the real clock.2.
RelayStaff: toast visibility before Sonner mountRoot cause. Sonner renders a new toast with
data-mounted="false". Its injected stylesheet keeps a toast atopacity: 0until a post-render effect setsdata-mounted="true"([data-sonner-toast][data-mounted='true']). The test assertedtoBeVisible()right afterfindByRole(...)for the detail view. Depending on scheduling, the toast node existed but hadn't flipped to mounted yet, so jsdom reported it as hidden.Fix. Wrap that assertion in
waitFor(() => expect(getByText(...)).toBeVisible()), waiting on the observable mounted state instead of assuming it already happened. The assertion is just as strict as before: the toast must actually become visible. The synchronoustoBeVisible()for the inlineNative enforcement detail(non-toast) stays as it was.Validation
bin/pnpm vitest run src/features/user-status/StatusEditor.test.tsx(local TZ)TZ=UTC bin/pnpm vitest run src/features/user-status/StatusEditor.test.tsxbin/pnpm vitest run src/bundled/relay-staff/RelayStaff.test.tsx×3Deferred / gaps
JavaScriptand browser splits are left to hosted CI.