From 465128d00201dc931e2bee0396d07cdbe167ce4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Sun, 1 Nov 2026 22:22:18 +0000 Subject: [PATCH] fix(cli): media-treatment says which media the file has when the selector matches none (#6958) --- .../cli/src/commands/media-treatment.test.ts | 18 ++++++++++++++++++ packages/cli/src/commands/media-treatment.ts | 16 +++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/media-treatment.test.ts b/packages/cli/src/commands/media-treatment.test.ts index 761543a30c..c7eb8d2ed9 100644 --- a/packages/cli/src/commands/media-treatment.test.ts +++ b/packages/cli/src/commands/media-treatment.test.ts @@ -222,6 +222,24 @@ describe("applyMediaTreatmentToHtml", () => { expect(result.html).toContain("data-color-grading="); }); + it("says what media the file has when the selector matches none", () => { + expect(() => applyMediaTreatmentToHtml(VIDEO, { selector: "#prepared", grading: {} })).toThrow( + "Selector did not match: #prepared. Media in the file: video#hero.", + ); + expect(() => + applyMediaTreatmentToHtml(SEGMENTS, { selector: "#prepared", grading: {} }), + ).toThrow('video[src="a.mp4"], video[src="b.mp4"].'); + }); + + it("says the file has no media yet when preparation added none", () => { + expect(() => + applyMediaTreatmentToHtml("", { + selector: "#prepared", + grading: {}, + }), + ).toThrow("Selector did not match: #prepared. The file has no