Skip to content

Commit

Permalink
test(intg): ensure evaluated value on entry screen
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Dec 22, 2022
1 parent a6c22ad commit de3202f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/components/CalculatorContainer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ describe("Component: CalculatorContainer", () => {
const evaluationScrn = wrapper.find(".evaluation-screen").element as HTMLInputElement
const entryScrn = wrapper.find(".entry-screen").element as HTMLInputElement

const wrapperInternals = wrapper.vm as any
const evaluateExpressionSpy = vitest.spyOn(wrapperInternals, "evaluateExpression")

// Find the digit "1" button and click it
const digitalBtns = wrapper.findAll(".digital-button")
const [digital1Btn] = digitalBtns.filter(btn => btn.text() === "1")
Expand All @@ -33,7 +30,6 @@ describe("Component: CalculatorContainer", () => {
const [equalBtn] = evaluationBtns.filter(btn => btn.text() === "=")
await equalBtn.trigger("click")
expect(evaluationScrn.value).toEqual("1 + 1 =")

expect(evaluateExpressionSpy).toHaveReturnedWith(2)
expect(entryScrn.value).toEqual("2")
})
})

0 comments on commit de3202f

Please sign in to comment.