Skip to content

Commit 2a831ba

Browse files
committed
test(provenance): assert the enforcement switch on a row it can act on
The test that pins "closing the surface refuses an unrecorded file again" used a stored unknown, which the split had just turned into a taint. A taint is refused whatever the flag says, so the assertion held with enforcement off too and proved nothing about the switch this posture rests on. It now uses a recorded absence, and fails if the flag is ignored.
1 parent 095fc99 commit 2a831ba

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/sim/lib/uploads/contexts/workspace/workspace-file-secret-provenance.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,11 @@ describe('workspace file secret provenance', () => {
13841384
)
13851385
})
13861386

1387+
/**
1388+
* The row has to be a recorded absence, not a refusal. A stored `unknown` is refused whatever the
1389+
* flag says, so asserting against one would pass with enforcement off and prove nothing about the
1390+
* switch this whole posture rests on.
1391+
*/
13871392
it('refuses an unrecorded file again once the surface is closed', async () => {
13881393
mockIsEnforced.mockReturnValue(true)
13891394
queueTableRows(workspaceFiles, [
@@ -1395,7 +1400,7 @@ describe('workspace file secret provenance', () => {
13951400
fileContentUpdatedAt: CONTENT_UPDATED_AT,
13961401
secretProvenanceVersion: 1,
13971402
provenanceContentUpdatedAt: CONTENT_UPDATED_AT,
1398-
status: 'unknown',
1403+
status: 'unrecorded',
13991404
entries: [],
14001405
},
14011406
])

0 commit comments

Comments
 (0)