From de3202f3533dcab469ef0e3fa3d9d51d462aceab Mon Sep 17 00:00:00 2001 From: "Jarlem Red J. de Peralta" Date: Thu, 22 Dec 2022 15:40:26 +0800 Subject: [PATCH] test(intg): ensure evaluated value on entry screen --- src/components/CalculatorContainer.test.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/CalculatorContainer.test.ts b/src/components/CalculatorContainer.test.ts index 2a0de94..dfe0d9a 100644 --- a/src/components/CalculatorContainer.test.ts +++ b/src/components/CalculatorContainer.test.ts @@ -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") @@ -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") }) })