Skip to content

Commit

Permalink
Remove input-number from renderer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywiebe committed Dec 13, 2024
1 parent 99e55b6 commit 9a18ac0
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/perseus/src/__tests__/renderer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {testDependencies} from "../../../../testing/test-dependencies";
import {
dropdownWidget,
imageWidget,
inputNumberWidget,
numericInputWidget,
question1,
question2,
definitionItem,
Expand Down Expand Up @@ -888,7 +888,7 @@ describe("renderer", () => {
images: {},
widgets: {
"dropdown 1": dropdownWidget,
"input-number 1": inputNumberWidget,
"input-number 1": numericInputWidget,
"image 1": imageWidget,
},
} as const;
Expand Down Expand Up @@ -1607,11 +1607,11 @@ describe("renderer", () => {
const {renderer} = renderQuestion({
...question2,
content:
"Input 1: [[☃ input-number 1]]\n\n" +
"Input 2: [[☃ input-number 2]]",
"Input 1: [[☃ numeric-input 1]]\n\n" +
"Input 2: [[☃ numeric-input 2]]",
widgets: {
...question2.widgets,
"input-number 2": question2.widgets["input-number 1"],
"numeric-input 2": question2.widgets["numeric-input 1"],
},
});
await userEvent.type(screen.getAllByRole("textbox")[0], "150");
Expand All @@ -1620,20 +1620,20 @@ describe("renderer", () => {
const emptyWidgets = renderer.emptyWidgets();

// Assert
expect(emptyWidgets).toStrictEqual(["input-number 2"]);
expect(emptyWidgets).toStrictEqual(["numeric-input 2"]);
});

it("should not return static widgets even if empty", () => {
// Arrange
const {renderer} = renderQuestion({
...question2,
content:
"Input 1: [[☃ input-number 1]]\n\n" +
"Input 2: [[☃ input-number 2]]",
"Input 1: [[☃ numeric-input 1]]\n\n" +
"Input 2: [[☃ numeric-input 2]]",
widgets: {
...question2.widgets,
"input-number 2": {
...question2.widgets["input-number 1"],
"numeric-input 2": {
...question2.widgets["numeric-input 1"],
static: true,
},
},
Expand All @@ -1643,7 +1643,7 @@ describe("renderer", () => {
const emptyWidgets = renderer.emptyWidgets();

// Assert
expect(emptyWidgets).toStrictEqual(["input-number 1"]);
expect(emptyWidgets).toStrictEqual(["numeric-input 1"]);
});

it("should return widget ID for group with empty widget", () => {
Expand Down Expand Up @@ -1750,8 +1750,8 @@ describe("renderer", () => {
"Another input widget: [[\u2603 input-number 2]]",
widgets: {
"image 1": imageWidget,
"input-number 1": inputNumberWidget,
"input-number 2": inputNumberWidget,
"input-number 1": numericInputWidget,
"input-number 2": numericInputWidget,
"dropdown 1": dropdownWidget,
},
images: {},
Expand Down

0 comments on commit 9a18ac0

Please sign in to comment.