Skip to content

Commit e30c536

Browse files
committed
test(supabase): pin both derived parameter groups, not just their total
Sixth instance of the vacuous-assertion pattern, found by auditing my own each() call sites rather than waiting for review. describe.each over an empty array emits no tests and no failure. KEY_PARAMS and FLAT_PARAMS are derived by filtering PATH_PARAMS on the 'path' name, so renaming that parameter would silently empty KEY_PARAMS and delete the entire legitimate object keys block — the assertions proving folder/sub/file.png survives byte-for-byte — while the floor on the total still passed. A floor on the sum cannot see a shift between the two groups. Verified non-vacuous: pointing the filter at a renamed parameter fails the new assertion where everything else still passed.
1 parent ce5f48c commit e30c536

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

apps/sim/tools/supabase/path_safety.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,21 @@ describe('supabase path traversal safety', () => {
100100
expect(PATH_PARAMS.length).toBeGreaterThanOrEqual(21)
101101
})
102102

103+
/**
104+
* Both derived groups are pinned, not just their total.
105+
*
106+
* `describe.each` over an empty array emits **no tests and no failure**, so
107+
* if `path` were renamed, `KEY_PARAMS` would silently empty and the entire
108+
* "legitimate object keys" block — the assertions proving
109+
* `folder/sub/file.png` survives byte-for-byte — would disappear while the
110+
* total above still passed. A floor on the sum cannot see a shift between the
111+
* two groups.
112+
*/
113+
it('keeps both parameter groups non-empty', () => {
114+
expect(KEY_PARAMS.length).toBeGreaterThanOrEqual(3)
115+
expect(FLAT_PARAMS.length).toBeGreaterThanOrEqual(18)
116+
})
117+
103118
describe.each(PATH_PARAMS)('$label', (param) => {
104119
itResistsTraversal(param, {
105120
origin: ORIGIN,

0 commit comments

Comments
 (0)