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(' { expect(wrapper).toMatchSnapshot() }) it('allows specifying a custom format', () => { const wrapperWithCustomFormat = shallowMount(LocalDatetime, { propsData: { timestamp: '1977-05-25 00:00:00', format: 'MMM Do YY', }, }) expect(wrapperWithCustomFormat).toMatchSnapshot() }) })