mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-10-02 00:23:23 +00:00
test(work-orders): scope the media-allowlist guard to photo categories
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.
This commit is contained in:
parent
af6faf77e3
commit
6212949fff
1 changed files with 11 additions and 2 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue