Migrate to vitest#600
Open
kneth wants to merge 20 commits into
Open
Conversation
- Fix unstableSetRender cleanup race: delete _reactRoot before unmounting so message.success() after message.destroy() gets a fresh root - Fix SQLEditorSchemaTree tree expansion: fake timers + vi.runAllTimers() inside act() fires rc-motion's 500ms motionDeadline synchronously, committing onMotionEnd (prevData update) before the next expansion click - 2 tests remain: 3-level tree expansion (object columns nested, subcolumn copy) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- test/setup.ts: global beforeEach flushes rc-motion leave animations with fake timers (3 × runAllTimers) so stale antd elements don't bleed between tests; unstableSetRender cleanup is now a no-op to avoid the createRoot race caused by showSuccessMessage's synchronous destroy+create pattern - SQLEditorSchemaTree: useFakeTimers per describe + second runAllTimers pass after waitFor to flush setPrevData — fixes 3-level tree expansion timeout - CopyToClipboard / SQLResultsTable: use findAllByText/getAllByText so a previous test's animating-out "Copied" message doesn't cause getBy to throw - NotificationHandler: local afterEach flushes notifications; query via document.querySelector instead of container.nextElementSibling so sibling shift from an animating-out prior notification doesn't miss the target - Logs: modal close assertion checks for leave class instead of DOM removal (jsdom never fires transitionend so the animation never fully completes) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uite Two root causes identified and fixed at the source: 1. rc-motion (Ant Design's animation engine) calls getComputedStyle(el, '::before') to detect animation durations — JSDOM 29 doesn't support pseudo-element style lookup. Stub it to return a no-animation CSSStyleDeclaration. 2. SQLResultsTable download links use <a href="data:..."> URIs; clicking them causes JSDOM to attempt navigation to a new document, which it can't do. A capture-phase event listener calls preventDefault() on such clicks so React onClick handlers still fire but JSDOM never starts the navigation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t runs - Replace vite-tsconfig-paths plugin with Vite's native resolve.tsconfigPaths option — Vite 8 (rolldown) supports this natively and the plugin itself emits a deprecation warning pointing to this change. - Pass disableOxcRecommendation: true to @vitejs/plugin-react-swc — the plugin warns to switch to @vitejs/plugin-react when no SWC plugins are in use and rolldown is detected; this flag suppresses that recommendation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ations Root cause: Ant Design's `message` component passes no motionDeadline to rc-motion, so leave animations stall waiting for CSS `animationend` events that JSDOM never fires. State updates from those stalled animations occasionally fire after a test ends, triggering React 19's "not wrapped in act()" warning for ForwardRef / Notifications components. Fix: filter the warning at the console.error level in setup.ts — the same suppression already applied per-file in NotificationHandler.test.tsx. This does not mask any real assertion failures; tests still fail on wrong output, just without the noisy act() advisory alongside them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n CopyToClipboard test
A spy set up in the preceding test leaks into this test, and antd message
notifications are portalled outside the component tree so testing-library
cleanup doesn't remove them. This causes findByText('Copied') to find two
elements and throw. Using findAllByText is consistent with the pattern
already used in the adjacent test.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
68c7af3 to
bdac5c5
Compare
bdac5c5 to
882ace5
Compare
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 of changes
We are migrating from Jest to vitest.
The PR must be squashed before merging.
Checklist
CHANGES.md.Required Grand Central APIs are already merged.