Skip to content

Commit

Permalink
test(helpers): ensure joining historyItem parts
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Jan 10, 2023
1 parent c555f55 commit 5b3c00e
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { HistoryItem } from "@/types/history"

import helper from "./joinHistoryItemParts"

describe("Component helper: joinHistoryItemParts", () => {
it("should join history item parts into a string", () => {
const historyItem = {
"leftOperand": 1,
"operation": "+",
"rightOperand": 1
} as HistoryItem

const expectedReturnValue = `${historyItem.leftOperand} ${historyItem.operation} ${historyItem.rightOperand}`
expect(helper(historyItem)).toEqual(expectedReturnValue)
})
})

0 comments on commit 5b3c00e

Please sign in to comment.