Skip to content

Commit

Permalink
chore(component): accept string value
Browse files Browse the repository at this point in the history
  • Loading branch information
lemredd committed Dec 20, 2022
1 parent 2777815 commit 6dfd958
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/CalculatorContainer/EntryScreen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ describe("Component: CalculatorContainer/EntryScreen", () => {
it("can change displayed value", async() => {
const wrapper = shallowMount(Component, {
"props": {
"valueToDisplay": 0
"valueToDisplay": "0"
}
})
const calculatorScreen = wrapper.find("input.entry-screen").element as HTMLInputElement
const calculatorScreenInitialValue = wrapper.props("valueToDisplay")
expect(calculatorScreen.value).toEqual(String(calculatorScreenInitialValue))

await wrapper.setProps({
"valueToDisplay": 1
"valueToDisplay": "1"
})
expect(calculatorScreen.value).toEqual("1")
})
Expand Down
4 changes: 2 additions & 2 deletions src/components/CalculatorContainer/EntryScreen.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script setup lang="ts">
interface Props {
valueToDisplay: number
valueToDisplay: string
}
defineProps<Props>()
</script>

<template>
<input
type="number"
type="text"
class="entry-screen"
disabled
:value="valueToDisplay"
Expand Down

0 comments on commit 6dfd958

Please sign in to comment.