Skip to content

Commit 93e234e

Browse files
committed
test(tables): pin the folder scope to single-select
`workspace-folder-selector` stores a string when multiSelect is falsy and an array when it is true. TableSelector's narrowing reads a string, so flipping this field to multi-select would make the scope read as absent and the picker would silently stop filtering. The coupling was real but unpinned; the File block's equivalent is deliberately multi-select.
1 parent e72a0ec commit 93e234e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎apps/sim/blocks/blocks/table-folders.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,18 @@ describe('table_v2 folder scope narrows the table picker', () => {
206206
expect(TableV2Block.inputs).not.toHaveProperty('folderSelection')
207207
})
208208

209+
it('stays single-select, because the picker reads its value as a path string', () => {
210+
/*
211+
* `workspace-folder-selector` stores a STRING when multiSelect is falsy and
212+
* an ARRAY when it is true. TableSelector's narrowing reads the value as a
213+
* string, so turning this multi-select would make the scope read as absent
214+
* and the picker would silently stop filtering — failing open, which is the
215+
* safe direction but not the intended one. The File block's equivalent IS
216+
* multi-select; tables narrow to one folder.
217+
*/
218+
expect(subBlock('folderSelection')?.multiSelect).toBeFalsy()
219+
})
220+
209221
it('has no advanced-mode twin, because a resolved reference would be discarded', () => {
210222
expect(subBlock('folderSelection')?.mode).toBe('basic')
211223
expect(subBlock('folderSelection')?.canonicalParamId).toBeUndefined()

0 commit comments

Comments
 (0)