Skip to content

fix: CI test failures for DetailView $expand params and PivotTable error state assertion#949

Merged
hotlong merged 2 commits intocopilot/fix-field-type-display-issuefrom
copilot/fix-ci-test-issue
Mar 2, 2026
Merged

fix: CI test failures for DetailView $expand params and PivotTable error state assertion#949
hotlong merged 2 commits intocopilot/fix-field-type-display-issuefrom
copilot/fix-ci-test-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

Three CI test failures introduced by PR #944's DetailView $expand changes.

  • RecordDetailEdit.test.tsxDetailView now passes params (even when undefined) as third arg to findOne(). Updated assertions to match the new call signature:

    // Before: findOne('contact', id)
    // After:  findOne('contact', id, undefined)  — $expand params slot
    expect(ds.findOne).toHaveBeenCalledWith('contact', 'contact-...', undefined);
  • ObjectPivotTable.test.tsxquerySelector returns null on miss, not undefined. toBeDefined() always passed, so waitFor never actually waited for the error state to render — classic race condition in CI.

    // Before: expect(errorEl).toBeDefined()  — always true (null ≠ undefined)
    // After:  expect(errorEl).not.toBeNull()  — actually gates on element presence
Original prompt

拉取请求: #944
fix ci test


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 2, 2026

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

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Mar 2, 2026 2:31am
objectui-demo Ready Ready Preview, Comment Mar 2, 2026 2:31am
objectui-storybook Ready Ready Preview, Comment Mar 2, 2026 2:31am

Request Review

…ble error state timing

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix CI test failure in project fix: CI test failures for DetailView $expand params and PivotTable error state assertion Mar 2, 2026
@hotlong hotlong marked this pull request as ready for review March 2, 2026 02:45
Copilot AI review requested due to automatic review settings March 2, 2026 02:45
@hotlong hotlong merged commit 33ec888 into copilot/fix-field-type-display-issue Mar 2, 2026
5 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes CI test regressions caused by PR #944’s DetailView $expand/findOne() signature change and a race condition in PivotTable error-state assertions.

Changes:

  • Update RecordDetailEdit tests to assert findOne(objectName, id, undefined) (third arg reserved for $expand params).
  • Fix PivotTable error-state test gating by checking querySelector(...) result is not null inside waitFor.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/console/src/tests/RecordDetailEdit.test.tsx Updates findOne call assertions to match new 3-arg signature used by DetailView.
packages/plugin-dashboard/src/tests/ObjectPivotTable.test.tsx Fixes waitFor assertion to properly wait for the error element to exist (handles querySelector returning null).

Comment on lines 78 to 81
await waitFor(() => {
const errorEl = container.querySelector('[data-testid="pivot-error"]');
expect(errorEl).toBeDefined();
expect(errorEl).not.toBeNull();
});
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this file, waitFor blocks that rely on container.querySelector(...) should not assert with toBeDefined(), because querySelector returns null on miss and null is still “defined” (so the callback can pass immediately and not actually wait). This hunk fixes the error-state case, but the same pattern still exists in the loading-skeleton and empty-state tests above; those should be updated to assert not.toBeNull() (or use toBeInTheDocument() if jest-dom matchers are available) so the waitFor actually gates on DOM presence.

Copilot uses AI. Check for mistakes.
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.

3 participants