Skip to content

Commit

Permalink
test(component): ensure proper selector & element
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Dec 22, 2022
1 parent 417cdb2 commit 1e13ba7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/CalculatorContainer/EvaluationScreen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ describe("Component: CalculatorContainer/EvaluationScreen", () => {
"valueToDisplay": "0"
}
})
const calculatorScreen = wrapper.find("input.evaluation-screen").element as HTMLInputElement
const calculatorScreen = wrapper.find(".evaluation-screen")
const calculatorScreenInitialValue = wrapper.props("valueToDisplay")
expect(calculatorScreen.value).toEqual(calculatorScreenInitialValue)
expect(calculatorScreen.text()).toEqual(calculatorScreenInitialValue)

await wrapper.setProps({
"valueToDisplay": "1"
})
expect(calculatorScreen.value).toEqual("1")
expect(calculatorScreen.text()).toEqual("1")
})
})
2 changes: 1 addition & 1 deletion src/components/CalculatorContainer/EvaluationScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defineProps<Props>()
</script>

<template>
<span>
<span class="evaluation-screen">
{{ valueToDisplay }}
</span>
</template>
Expand Down

0 comments on commit 1e13ba7

Please sign in to comment.