From 6212949fff9781d4de1767561e476448a4ad1a4d Mon Sep 17 00:00:00 2001 From: Alexandre Brandizzi Date: Thu, 10 Sep 2026 14:46:54 -0300 Subject: [PATCH] test(work-orders): scope the media-allowlist guard to photo categories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updating this branch onto dev turned MediaRules_StillRejectPdf red, and the test was the thing that had gone stale, not the rule. SH-171 added documents to the SH-116 media allowlist for Extra and Aveta in 3454125 — a deliberate widening with its own review — so asserting that media rejects a PDF outright now contradicts shipped behaviour. What this branch actually needs guarded is that the completion-doc allowlist stopped there. Assert it per category instead: Completion, the category SH-337 touches, plus Before and After, must all still refuse a PDF. --- SeaHavenIndustries.Tests/WorkOrderPhase6Tests.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/SeaHavenIndustries.Tests/WorkOrderPhase6Tests.cs b/SeaHavenIndustries.Tests/WorkOrderPhase6Tests.cs index a73c6f3..ce285c1 100644 --- a/SeaHavenIndustries.Tests/WorkOrderPhase6Tests.cs +++ b/SeaHavenIndustries.Tests/WorkOrderPhase6Tests.cs @@ -1930,10 +1930,19 @@ public class WorkOrderCompletionDocFileRulesTests } [Fact] - public void MediaRules_StillRejectPdf() + public void MediaRules_StillRejectPdfOutsideDocumentCategories() { // The completion-doc allowlist must not widen the SH-116 media allowlist. - Assert.False(WorkOrderMediaFileRules.IsAllowed(FormFile(Pdf, "completion.pdf", "application/pdf"))); + // SH-171 since added documents to media for Extra and Aveta, which is a + // deliberate widening of its own; what this guards is that it stopped + // there. Completion is the category SH-337 touches, and a photo slot + // must still refuse a PDF. + Assert.False(WorkOrderMediaFileRules.IsAllowed( + FormFile(Pdf, "completion.pdf", "application/pdf"), WorkOrderMediaCategory.Completion)); + Assert.False(WorkOrderMediaFileRules.IsAllowed( + FormFile(Pdf, "completion.pdf", "application/pdf"), WorkOrderMediaCategory.Before)); + Assert.False(WorkOrderMediaFileRules.IsAllowed( + FormFile(Pdf, "completion.pdf", "application/pdf"), WorkOrderMediaCategory.After)); } }