From 3e6e94886e21d32079fcd3880e44afbe2b976847 Mon Sep 17 00:00:00 2001 From: Carey Gumaer Date: Fri, 6 Dec 2024 13:26:12 -0500 Subject: [PATCH 1/2] specify non-free course for differing prices test --- .../src/learning-resources/learning-resources.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontends/ol-utilities/src/learning-resources/learning-resources.test.ts b/frontends/ol-utilities/src/learning-resources/learning-resources.test.ts index d1a665c18e..37bb4e3852 100644 --- a/frontends/ol-utilities/src/learning-resources/learning-resources.test.ts +++ b/frontends/ol-utilities/src/learning-resources/learning-resources.test.ts @@ -123,7 +123,10 @@ describe("allRunsAreIdentical", () => { }) test("returns false if prices differ", () => { - const resource = factories.learningResources.resource() + const resource = factories.learningResources.resource({ + free: false, + certification: false, + }) const prices = [{ amount: "100", currency: "USD" }] const delivery = [ { code: CourseResourceDeliveryInnerCodeEnum.InPerson, name: "In person" }, From a36656002f76580ef0b77dc62ca27d8f7ad694c9 Mon Sep 17 00:00:00 2001 From: Carey Gumaer Date: Fri, 6 Dec 2024 13:48:34 -0500 Subject: [PATCH 2/2] specify free and certification in other places where it's necessary --- .../src/learning-resources/learning-resources.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/frontends/ol-utilities/src/learning-resources/learning-resources.test.ts b/frontends/ol-utilities/src/learning-resources/learning-resources.test.ts index 37bb4e3852..5ef4fcb428 100644 --- a/frontends/ol-utilities/src/learning-resources/learning-resources.test.ts +++ b/frontends/ol-utilities/src/learning-resources/learning-resources.test.ts @@ -96,7 +96,10 @@ describe("allRunsAreIdentical", () => { }) test("returns true if all runs are identical", () => { - const resource = factories.learningResources.resource() + const resource = factories.learningResources.resource({ + free: false, + certification: false, + }) const prices = [{ amount: "100", currency: "USD" }] const delivery = [ { code: CourseResourceDeliveryInnerCodeEnum.InPerson, name: "In person" }, @@ -153,12 +156,14 @@ describe("allRunsAreIdentical", () => { }) test("returns true if prices differ but have same numerical value", () => { - const resource = factories.learningResources.resource() + const resource = factories.learningResources.resource({ + free: true, + certification: false, + }) const delivery = [ { code: CourseResourceDeliveryInnerCodeEnum.InPerson, name: "In person" }, ] const location = "New York" - resource.free = true resource.runs = [ makeRun({ resource_prices: [{ amount: "0", currency: "USD" }],