feat: add BaseCheckbox tests
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Dominik Pschenitschni 2022-04-11 21:04:38 +02:00
parent 006c0259e5
commit 5bf738ceef
Signed by: dpschen
GPG Key ID: B257AC0149F43A77
2 changed files with 39 additions and 0 deletions

View File

@ -1,6 +1,7 @@
<template>
<div class="base-checkbox" v-cy="'checkbox'">
<input
data-cy="base-checkbox"
type="checkbox"
:id="checkboxId"
class="is-sr-only"

View File

@ -0,0 +1,38 @@
import { describe, it, expect } from 'vitest'
import { mount } from '@vue/test-utils'
import BaseCheckbox from '../BaseCheckbox.vue'
describe('BaseCheckbox', () => {
it('renders properly', () => {
const wrapper = mount(BaseCheckbox, { props: {
checked: true,
} })
cy.get('[data-cy="base-checkbox"]').should('exist')
// expect(wrapper.text()).toContain('Hello Vitest')
})
})
describe('BaseCheckbox', () => {
it('renders the checkbox (invisible)', () => {
mount(BaseCheckbox, {
checked: true,
})
cy.get('[data-cy="base-checkbox"]').should('exist')
})
// it('contains the correct number of todos', () => {
// const todos = [
// { text: 'Buy milk', id: 1 },
// { text: 'Learn Component Testing', id: 2 },
// ]
// mount(<TodoList todos={todos} />)
// cy.get('[data-testid=todos]').should('have.length', todos.length)
// })
})