Skip to content

Commit

Permalink
chore(component): rename to EvaluationScreen
Browse files Browse the repository at this point in the history
fix #26
  • Loading branch information
lemredd committed Dec 20, 2022
1 parent 725997c commit 5be27c4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/CalculatorContainer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Component from "./CalculatorContainer.vue"
describe("Component: CalculatorContainer", () => {
it("can evaluate a proper expression", async() => {
const wrapper = mount(Component)
const calculatorScreen = wrapper.find(".calculator-screen").element as HTMLInputElement
const calculatorScreen = wrapper.find(".evaluation-screen").element as HTMLInputElement

const wrapperInternals = wrapper.vm as any
const evaluateExpressionSpy = vitest.spyOn(wrapperInternals, "evaluateExpression")
Expand Down
2 changes: 1 addition & 1 deletion src/components/CalculatorContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { PossibleButtonValues } from "@/types/buttons"
import evaluate from "@/CalculatorContainer/helpers/evaluate"
import Screen from "@/CalculatorContainer/CalculatorScreen.vue"
import Screen from "@/CalculatorContainer/EvaluationScreen.vue"
import DigitalButton from "@/CalculatorContainer/DigitalButton.vue"
import EvaluationButton from "@/CalculatorContainer/EvaluationButton.vue"
import OperationalButton from "@/CalculatorContainer/OperationalButton.vue"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { shallowMount } from "@vue/test-utils"

import Component from "./CalculatorScreen.vue"
import Component from "./EvaluationScreen.vue"

describe("Component: CalculatorContainer/CalculatorScreen", () => {
describe("Component: CalculatorContainer/EvaluationScreen", () => {
it("can change displayed value", async() => {
const wrapper = shallowMount(Component, {
"props": {
"valueToDisplay": "0"
}
})
const calculatorScreen = wrapper.find("input.calculator-screen").element as HTMLInputElement
const calculatorScreen = wrapper.find("input.evaluation-screen").element as HTMLInputElement
const calculatorScreenInitialValue = wrapper.props("valueToDisplay")
expect(calculatorScreen.value).toEqual(calculatorScreenInitialValue)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defineProps<Props>()
<template>
<input
type="text"
class="calculator-screen"
class="evaluation-screen"
disabled
:value="valueToDisplay"
>
Expand Down

0 comments on commit 5be27c4

Please sign in to comment.