mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add test InputHour.spec.js
This commit is contained in:
parent
e31214b1e1
commit
11a222749d
46
frontend/src/components/Inputs/InputHour.spec.js
Normal file
46
frontend/src/components/Inputs/InputHour.spec.js
Normal 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)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="input-time">
|
<div class="input-hour">
|
||||||
<validation-provider
|
<validation-provider
|
||||||
tag="div"
|
tag="div"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user