Fix test suite for schema evolution: import paths, filter syntax, capability fields#143
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…and test expectations Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
eb5d00d
into
copilot/fix-action-step-issue-another-one
There was a problem hiding this comment.
Pull request overview
This PR addresses test failures caused by schema evolution across three test files. The changes align tests with updated schemas for API endpoints, contract specifications, and object capabilities.
Changes:
- Updated import paths in endpoint.test.ts from non-existent
../system/api.zodto correct locations (./endpoint.zodand./router.zod) - Migrated filter syntax in contract.test.ts from deprecated array format (
filters: ['status', '=', 'active']) to object-based format (where: { status: 'active' }) - Updated capability field names in object.test.ts from
feedEnabledtofeedsand added new capability fields (activities,mru,clone)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/spec/src/api/endpoint.test.ts | Fixed import paths and updated HttpMethod tests to include HEAD and OPTIONS as valid methods |
| packages/spec/src/api/contract.test.ts | Migrated export request test from array-based filter syntax to object-based where clause |
| packages/spec/src/data/object.test.ts | Updated capability field tests from feedEnabled to feeds and added new capability fields (activities, mru, clone) |
| expect(result.feeds).toBe(false); | ||
| expect(result.activities).toBe(false); | ||
| expect(result.trash).toBe(true); | ||
| expect(result.mru).toBe(true); | ||
| expect(result.clone).toBe(true); |
There was a problem hiding this comment.
Incomplete migration: While this test case has been updated to use the new capability fields (feeds, activities, mru, clone), there are other test cases in the same file at lines 217, 308, and 379 that still use the deprecated 'feedEnabled' field. These need to be updated to 'feeds' as well, and should include the new capability fields to ensure complete test coverage. The schema no longer accepts 'feedEnabled' (see object.zod.ts line 45), so those tests would fail.
Three test files failed due to schema evolution. Tests were using outdated import paths, deprecated filter syntax, and old capability field names.
Changes
endpoint.test.ts
../system/api.zod→./endpoint.zod+./router.zod(file never existed in system/)HEADandOPTIONSnow accepted per router schemacontract.test.ts
FilterConditionSchema(object-based, MongoDB-style)object.test.ts
feedEnabled→feeds, addedactivities,clone,mruAll 1577 tests passing.
Original prompt
💡 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.