Add initial component test

This commit is contained in:
Patrick Smith 2018-11-19 21:01:51 -05:00
parent 4149a4f1d5
commit 75155f5297
2 changed files with 20 additions and 0 deletions

View File

@ -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>`;

View 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()
})
})