Skip to content

Commit

Permalink
Another small util test
Browse files Browse the repository at this point in the history
  • Loading branch information
nishasy committed Mar 14, 2024
1 parent 9f924aa commit 688c291
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/perseus-editor/src/components/__tests__/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ describe("getValidNumberFromString", () => {
expect(getValidNumberFromString("123")).toBe(123);
});

test("should return a negative number from a string", () => {
expect(getValidNumberFromString("-123")).toBe(-123);
});

test("should return 0 from an invalid string", () => {
expect(getValidNumberFromString("abc")).toBe(0);
});
Expand Down

0 comments on commit 688c291

Please sign in to comment.