Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/pages/components/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { Input } from "@/components/input"
</script>

<template>
<Input data-cy="input" />
<Input placeholder="Enter your name" data-cy="input" />
</template>
2 changes: 2 additions & 0 deletions src/components/input/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const props = defineProps<{
defaultValue?: string | number
modelValue?: string | number
class?: HTMLAttributes["class"]
placeholder?: string
}>()

const emits = defineEmits<{
Expand All @@ -22,6 +23,7 @@ const modelValue = useVModel(props, "modelValue", emits, {
<template>
<input
v-model="modelValue"
:placeholder
:class="
cn(
'flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
Expand Down
6 changes: 5 additions & 1 deletion src/components/input/input.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
describe("template spec", () => {
it("passes", () => {
beforeEach(() => {
cy.visit("/components/input")
})

it("contains placeholder", () => {
cy.get("input").should("exist").and("have.attr", "placeholder", "Enter your name")
})
})