From d5270fa97d2aa2bd058bde9764147bb383b66c27 Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Tue, 20 Nov 2018 10:02:17 -0500 Subject: [PATCH] Add additional snapshot test --- .../__snapshots__/local_datetime.test.js.snap | 2 ++ js/components/__tests__/local_datetime.test.js | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/js/components/__tests__/__snapshots__/local_datetime.test.js.snap b/js/components/__tests__/__snapshots__/local_datetime.test.js.snap index 904778e1..78b3e555 100644 --- a/js/components/__tests__/__snapshots__/local_datetime.test.js.snap +++ b/js/components/__tests__/__snapshots__/local_datetime.test.js.snap @@ -1,3 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`LocalDatetime allows specifying a custom format 1`] = ``; + exports[`LocalDatetime matches snapshot 1`] = ``; diff --git a/js/components/__tests__/local_datetime.test.js b/js/components/__tests__/local_datetime.test.js index 1a44173b..969a797e 100644 --- a/js/components/__tests__/local_datetime.test.js +++ b/js/components/__tests__/local_datetime.test.js @@ -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() + }) })