Add additional snapshot test

This commit is contained in:
Patrick Smith 2018-11-20 10:02:17 -05:00
parent fae3aa12e1
commit d5270fa97d
2 changed files with 14 additions and 0 deletions

View File

@ -1,3 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`LocalDatetime allows specifying a custom format 1`] = `<time datetime="1977-05-25 00:00:00">May 25th 77</time>`;
exports[`LocalDatetime matches snapshot 1`] = `<time datetime="1977-05-25 00:00:00">May 25 1977 0:00</time>`;

View File

@ -14,4 +14,16 @@ describe('LocalDatetime', () => {
it('matches snapshot', () => {
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()
})
})