diff --git a/frontend/src/components/Inputs/InputHour.spec.js b/frontend/src/components/Inputs/InputHour.spec.js new file mode 100644 index 000000000..2c2eb8f33 --- /dev/null +++ b/frontend/src/components/Inputs/InputHour.spec.js @@ -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) + }) + }) +}) diff --git a/frontend/src/components/Inputs/InputHour.vue b/frontend/src/components/Inputs/InputHour.vue index 98e79e233..d99fea4a3 100644 --- a/frontend/src/components/Inputs/InputHour.vue +++ b/frontend/src/components/Inputs/InputHour.vue @@ -1,5 +1,5 @@