diff --git a/packages/perseus/src/widgets/expression/expression.test.tsx b/packages/perseus/src/widgets/expression/expression.test.tsx index 3a35cdaa96..d0e102f4dd 100644 --- a/packages/perseus/src/widgets/expression/expression.test.tsx +++ b/packages/perseus/src/widgets/expression/expression.test.tsx @@ -17,7 +17,10 @@ import { expressionItemWithLabels, } from "./expression.testdata"; -import type {PerseusItem} from "../../perseus-types"; +import type { + PerseusExpressionWidgetOptions, + PerseusItem, +} from "../../perseus-types"; import type {UserEvent} from "@testing-library/user-event"; const renderAndAnswer = async ( @@ -535,9 +538,7 @@ describe("Expression Widget", function () { value: "42", }; - const result = ExpressionWidgetExport.propUpgrades["1"](v0props); - - expect(result).toEqual({ + const expected: PerseusExpressionWidgetOptions = { times: false, buttonSets: ["basic"], functions: [], @@ -549,7 +550,11 @@ describe("Expression Widget", function () { value: "42", }, ], - }); + }; + + const result = ExpressionWidgetExport.propUpgrades["1"](v0props); + + expect(result).toEqual(expected); }); }); }); diff --git a/packages/perseus/src/widgets/measurer/measurer.test.tsx b/packages/perseus/src/widgets/measurer/measurer.test.tsx index c55c786209..70ec179f24 100644 --- a/packages/perseus/src/widgets/measurer/measurer.test.tsx +++ b/packages/perseus/src/widgets/measurer/measurer.test.tsx @@ -1,5 +1,7 @@ import MeasurerWidgetExport from "./measurer"; +import type {PerseusMeasurerWidgetOptions} from "../../perseus-types"; + describe("measurer", () => { describe("propUpgrades", () => { it("can upgrade from v0 to v1", () => { @@ -17,9 +19,7 @@ describe("measurer", () => { static: false, }; - const result = MeasurerWidgetExport.propUpgrades["1"](v0props); - - expect(result).toEqual({ + const expected: PerseusMeasurerWidgetOptions = { image: { url: "url", top: 42, @@ -33,7 +33,11 @@ describe("measurer", () => { rulerLength: 4, box: [4, 4], static: false, - }); + }; + + const result = MeasurerWidgetExport.propUpgrades["1"](v0props); + + expect(result).toEqual(expected); }); }); }); diff --git a/packages/perseus/src/widgets/radio/__tests__/radio.test.ts b/packages/perseus/src/widgets/radio/__tests__/radio.test.ts index 0eb7393801..02b8b72a32 100644 --- a/packages/perseus/src/widgets/radio/__tests__/radio.test.ts +++ b/packages/perseus/src/widgets/radio/__tests__/radio.test.ts @@ -18,7 +18,10 @@ import { shuffledNoneQuestion, } from "./radio.testdata"; -import type {PerseusRenderer} from "../../../perseus-types"; +import type { + PerseusRadioWidgetOptions, + PerseusRenderer, +} from "../../../perseus-types"; import type {APIOptions} from "../../../types"; import type {PerseusRadioUserInput} from "../../../validation.types"; import type {UserEvent} from "@testing-library/user-event"; @@ -992,12 +995,14 @@ describe("propsUpgrade", () => { choices: [{content: "Choice 1"}, {content: "Choice 2"}], }; - const result = RadioWidgetExport.propUpgrades["1"](v0props); - - expect(result).toEqual({ + const expected: PerseusRadioWidgetOptions = { choices: [{content: "Choice 1"}, {content: "Choice 2"}], hasNoneOfTheAbove: false, - }); + }; + + const result = RadioWidgetExport.propUpgrades["1"](v0props); + + expect(result).toEqual(expected); }); it("throws from noneOfTheAbove", () => {