Improve test coverage with Vitest: allowlist, CSV import, and RLS fixes#262
Draft
cyrillical00 wants to merge 1 commit into
Draft
Improve test coverage with Vitest: allowlist, CSV import, and RLS fixes#262cyrillical00 wants to merge 1 commit into
cyrillical00 wants to merge 1 commit into
Conversation
…a matching - Fix RLS schema-prefix mismatch: table names with schema prefix (e.g. public.users) were not matched against bare table names from SQL queries, so WHERE clauses were silently not applied to restricted tables - Fix RLS wildcard action (*) not recognized in the restriction check - Fix null-safety for subquery FROM items (table field is null for subquery refs) - Fix test isolation: mockConfig.role mutation persisted across test suites - Add 7 meaningful tests for src/allowlist/index.ts (previously 0% coverage) - Add 10 meaningful tests for src/import/csv.ts (previously untested) - Update RLS test expectations to reflect correct implementation behavior - All 173 tests pass (previously 151 passing with 4 pre-existing failures)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #71
Summary
public.users) were not matched against bare table names in SQL queries, so WHERE clauses were silently not applied to restricted tables*action: Wildcard actions were not recognized in the restriction checkfromTable.tableis null for subquery refs, causing a TypeErrormockConfig.rolemutation in one test suite persisted into subsequent suitessrc/allowlist/index.ts— previously at 0% coveragesrc/import/csv.ts— previously untestedTest plan
pnpm testpasses (all 173 tests)