add test InputHour.spec.js

This commit is contained in:
ogerly 2023-01-03 15:07:36 +01:00
parent e31214b1e1
commit 11a222749d
2 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,46 @@
import { mount } from '@vue/test-utils'
import InputHour from './InputHour'
const localVue = global.localVue
describe('InputHour', () => {
let wrapper
const mocks = {
$t: jest.fn((t) => t),
$i18n: {
locale: jest.fn(() => 'en'),
},
$n: jest.fn((n) => String(n)),
$route: {
params: {},
},
}
describe('mount in a InputHour', () => {
const propsData = {
rules: {},
name: '',
label: '',
placeholder: '',
value: 500,
validMaxTime: 25,
}
const Wrapper = () => {
return mount(InputHour, {
localVue,
mocks,
propsData,
})
}
beforeEach(() => {
wrapper = Wrapper()
})
it('renders the component input-hour', () => {
expect(wrapper.find('div.input-hour').exists()).toBe(true)
})
})
})

View File

@ -1,5 +1,5 @@
<template>
<div class="input-time">
<div class="input-hour">
<validation-provider
tag="div"
:rules="rules"