Skip to content

fix(fields): await async data load in renderGrid slot test + fix Vercel build#1279

Merged
hotlong merged 2 commits into
mainfrom
copilot/update-action-job-configuration-again
May 4, 2026
Merged

fix(fields): await async data load in renderGrid slot test + fix Vercel build#1279
hotlong merged 2 commits into
mainfrom
copilot/update-action-job-configuration-again

Conversation

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor

RecordPickerDialog renderGrid slot test was flaky because it asserted on all renderGrid calls including the initial render (empty state before async fetch resolves).

  • Changed toHaveBeenCalledWithtoHaveBeenLastCalledWith inside waitFor to assert on the post-fetch render
  • Split function-type prop checks into separate assertions on the last call args to avoid Any<Function> matcher issues
  • Removed non-existent pnpm msw:init step from apps/console/vercel.json buildCommand that caused Vercel deployment failures (exit code 254). Since the deploy uses VITE_USE_MOCK_SERVER=false (server mode), MSW initialization is unnecessary.
// Before: fails because first call has records: [], totalCount: 0
expect(renderGrid).toHaveBeenCalledWith(
  expect.objectContaining({ records: expect.arrayContaining([...]) })
);

// After: waits for data-loaded render
await waitFor(() => {
  expect(renderGrid).toHaveBeenLastCalledWith(
    expect.objectContaining({ records: expect.arrayContaining([...]), loading: false })
  );
});

The test asserted renderGrid was called with populated records
immediately, but the component renders initially with empty state
before the async fetch resolves. Changed to toHaveBeenLastCalledWith
inside waitFor to properly await the data-loaded render.

Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/bd086065-c65e-4f73-9b25-4fd3976d67e2

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@vercel

vercel Bot commented May 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui-demo Ready Ready Preview, Comment May 4, 2026 0:26am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored May 4, 2026 0:26am

Request Review

@hotlong

hotlong commented May 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot vercel build failed

Command "cd ../.. && pnpm --filter @object-ui/app-shell... build && cd apps/console && pnpm msw:init && NODE_OPTIONS=--max-old-space-size=4096 VITE_USE_MOCK_SERVER=false VITE_BASE_PATH=/ vite build" exited with 254

The buildCommand in vercel.json referenced `pnpm msw:init` but no such
script exists in apps/console/package.json, causing exit code 254.
Since VITE_USE_MOCK_SERVER=false in the Vercel deploy (server mode),
MSW is not needed and the step can be safely removed.

Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/debc340f-7dee-423b-a14b-beddf51c85dc

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot vercel build failed

Command "cd ../.. && pnpm --filter @object-ui/app-shell... build && cd apps/console && pnpm msw:init && NODE_OPTIONS=--max-old-space-size=4096 VITE_USE_MOCK_SERVER=false ...

Fixed in a4de8a7. The vercel.json buildCommand referenced pnpm msw:init but that script doesn't exist in apps/console/package.json. Since the Vercel deploy uses VITE_USE_MOCK_SERVER=false (server mode), MSW isn't needed — removed the step from the build command.

Copilot AI changed the title fix(fields): await async data load in renderGrid slot test fix(fields): await async data load in renderGrid slot test + fix Vercel build May 4, 2026
Copilot finished work on behalf of hotlong May 4, 2026 00:25
Copilot AI requested a review from hotlong May 4, 2026 00:25
@hotlong hotlong marked this pull request as ready for review May 4, 2026 00:28
@hotlong hotlong merged commit 9eac9b5 into main May 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants