html-embed: upgrade create/duplicate/import gate tests from source-regex to real execution #27
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in security review of PR #16 (merged in
7a03321d).Severity: medium (test quality; production code is correct).
The gate tests for the create/duplicate/import write paths assert gate presence with brittle
expect(SRC).toMatch(/regex/)against the source text and a reimplementedapplyGate()stand-in, instead of executing the real methods with a member role and asserting the embed is actually stripped.apps/server/src/core/page/services/page-service-html-embed-identity.spec.ts(~L80-102),apps/server/src/integrations/import/services/import-html-embed-identity.spec.ts(~L91-121).page.service.create(),page.service.duplicatePage(),import.service,file-import-task.service.Fix: rewrite to execute the real methods with a non-admin/member role and assert a member's embed is stripped end-to-end, matching the quality of the existing collab/persistence/share specs.