Add initial component test
This commit is contained in:
parent
4149a4f1d5
commit
75155f5297
@ -0,0 +1,3 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`LocalDatetime matches snapshot 1`] = `<time datetime="1977-05-25 00:00:00">May 25 1977 0:00</time>`;
|
17
js/components/__tests__/local_datetime.test.js
Normal file
17
js/components/__tests__/local_datetime.test.js
Normal file
@ -0,0 +1,17 @@
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
|
||||
import LocalDatetime from '../local_datetime'
|
||||
|
||||
|
||||
describe('LocalDatetime', () => {
|
||||
const wrapper = shallowMount(LocalDatetime, { propsData: { timestamp: '1977-05-25 00:00:00' } })
|
||||
|
||||
it('renders a time element', () => {
|
||||
expect(wrapper.html()).toContain('<time')
|
||||
expect(wrapper.html()).toContain('May 25 1977')
|
||||
})
|
||||
|
||||
it('matches snapshot', () => {
|
||||
expect(wrapper).toMatchSnapshot()
|
||||
})
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user