Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… RecordDetailEdit highlight fields config Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes CI failures by correcting two tests whose assertions/configuration prevented them from exercising the intended UI states.
Changes:
- Updated
ObjectDataTablefetch-failure test assertions to avoid a false-positivetoBeDefined()check on aquerySelectorresult. - Added missing
views.detail.highlightFieldsto theRecordDetailEdittest fixture so the highlight banner renders during the test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/plugin-dashboard/src/tests/ObjectDataTable.test.tsx | Fixes a flaky/incorrect assertion so the error state is actually awaited and asserted. |
| apps/console/src/tests/RecordDetailEdit.test.tsx | Adds required object metadata so highlight fields render as expected in the test. |
| await waitFor(() => { | ||
| const errorEl = container.querySelector('[data-testid="table-error"]'); | ||
| expect(errorEl).toBeDefined(); | ||
| expect(errorEl).toBeTruthy(); | ||
| }); | ||
|
|
||
| expect(screen.getByText('Connection refused')).toBeDefined(); | ||
| expect(screen.getByText('Connection refused')).toBeTruthy(); |
There was a problem hiding this comment.
In this test, querySelector(...) returns Element | null, so the most precise assertion is toBeInTheDocument() (or using screen.getByTestId/getByText directly) rather than toBeTruthy(). Also, the same toBeDefined() + querySelector(...) pattern still exists elsewhere in this file (e.g., loading/empty-state checks) and will still pass even when the element is null, so those assertions should be updated too for the tests to actually wait for the UI state.
ObjectDataTable.test.tsx— "should show error state on fetch failure":waitForusestoBeDefined()onquerySelectorresult, butnull !== undefinedso it always passes without waiting. Changed totoBeTruthy().RecordDetailEdit.test.tsx— "renders highlight fields for key field types": testobjectsWithStatuslacksviews.detail.highlightFields, so highlight banner never renders. Added the missing config.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.