Skip to content

Commit 9eac9b5

Browse files
authored
Merge pull request #1279 from objectstack-ai/copilot/update-action-job-configuration-again
2 parents 01d4b76 + a4de8a7 commit 9eac9b5

3 files changed

Lines changed: 39 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- **`@object-ui/fields`**: Fixed flaky `RecordPickerDialog` test that asserted
13+
`renderGrid` slot props before async data fetch had completed. The test now
14+
awaits the final render with populated records before asserting.
15+
- **`apps/console`**: Removed non-existent `pnpm msw:init` step from Vercel
16+
build command that caused deployment failures (exit code 254).
17+
1018
### Changed
1119

1220
- **`MetadataProvider` now lazy-loads metadata.** Previously the console

apps/console/vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://openapi.vercel.sh/vercel.json",
33
"installCommand": "cd ../.. && pnpm install --frozen-lockfile",
4-
"buildCommand": "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",
4+
"buildCommand": "cd ../.. && pnpm --filter @object-ui/app-shell... build && cd apps/console && NODE_OPTIONS=--max-old-space-size=4096 VITE_USE_MOCK_SERVER=false VITE_BASE_PATH=/ vite build",
55
"outputDirectory": "dist",
66
"framework": "vite",
77
"rewrites": [

packages/fields/src/record-picker.test.tsx

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,29 +1113,36 @@ describe('RecordPickerDialog — renderGrid slot', () => {
11131113
expect(screen.getByTestId('custom-grid')).toBeInTheDocument();
11141114
});
11151115

1116-
// renderGrid should have been called with grid slot props
1117-
expect(renderGrid).toHaveBeenCalledWith(
1118-
expect.objectContaining({
1119-
columns: expect.arrayContaining([
1120-
expect.objectContaining({ field: 'name' }),
1121-
]),
1122-
records: expect.arrayContaining([
1123-
expect.objectContaining({ id: '1', name: 'Acme Corp' }),
1124-
]),
1125-
loading: false,
1126-
totalCount: 1,
1127-
currentPage: 1,
1128-
pageSize: 10,
1129-
sortField: null,
1130-
sortDirection: 'asc',
1131-
onSort: expect.any(Function),
1132-
onPageChange: expect.any(Function),
1133-
onRowClick: expect.any(Function),
1134-
isSelected: expect.any(Function),
1135-
multiple: false,
1136-
idField: 'id',
1137-
}),
1138-
);
1116+
// Wait for data to load, then check the last renderGrid call has records
1117+
await waitFor(() => {
1118+
expect(renderGrid).toHaveBeenLastCalledWith(
1119+
expect.objectContaining({
1120+
columns: expect.arrayContaining([
1121+
expect.objectContaining({ field: 'name' }),
1122+
]),
1123+
records: expect.arrayContaining([
1124+
expect.objectContaining({ id: '1', name: 'Acme Corp' }),
1125+
]),
1126+
loading: false,
1127+
totalCount: 1,
1128+
}),
1129+
);
1130+
});
1131+
1132+
// Verify all expected props are present in the last call
1133+
const lastCallArgs = renderGrid.mock.calls[renderGrid.mock.calls.length - 1][0];
1134+
expect(lastCallArgs).toMatchObject({
1135+
currentPage: 1,
1136+
pageSize: 10,
1137+
sortField: null,
1138+
sortDirection: 'asc',
1139+
multiple: false,
1140+
idField: 'id',
1141+
});
1142+
expect(lastCallArgs.onSort).toBeTypeOf('function');
1143+
expect(lastCallArgs.onPageChange).toBeTypeOf('function');
1144+
expect(lastCallArgs.onRowClick).toBeTypeOf('function');
1145+
expect(lastCallArgs.isSelected).toBeTypeOf('function');
11391146
});
11401147

11411148
it('hides built-in table when renderGrid is provided', async () => {

0 commit comments

Comments
 (0)