Repository navigation
test(studio): cover SQL content remap and upsert response remap - #47445
Conversation
The sql <-> unchecked_sql remap is important for self-hosted SQL snippets (the API stores/returns content.sql; the editor reads unchecked_sql), but the helpers in content-remap.ts had no direct coverage, and the upsert-response remap added in #47409 was unguarded - deleting it would silently reintroduce the blank-editor-after-move/rename bug with nothing failing. Add unit tests for remapSqlContentField/remapSqlContentFields/unmapSqlContentField (including the leave-unchanged guards and a remap→unmap round-trip), and an MSW test asserting upsertContent remaps the PUT response (plus the null passthrough). (via Claude Opus 4.8)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
5 Skipped Deployments
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds two new Vitest test files: one covering ChangesSQL Content Remap & Upsert Tests
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎭 Playwright Test ResultsDetails
Flaky testsFeatures › database.spec.ts › Database › Schema Visualizer › table actions work as expected Skipped testsFeatures › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled |
Braintrust eval report
|
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Adds unit coverage for the
content.sql<->content.unchecked_sqlremap that self-hosted SQL snippets depend on.The API persists and returns the SQL body under
content.sql, while the editor readscontent.unchecked_sql;content-remap.tsbridges the two and is used at every read/write boundary (6 files). Cover the following:content-remap.ts's helpers had no direct tests.New tests
content-remap.test.ts-remapSqlContentField/remapSqlContentFields/unmapSqlContentField: happy paths, the "leave unchanged" guards (non-SQL, nocontent, missing field), and a remap→unmap round-trip invariant.content-upsert-mutation.test.ts- MSW test assertingupsertContentremaps the PUT response (content.sql→unchecked_sql), plus thenull-response passthrough.Summary by CodeRabbit