Skip to content

Commit

Permalink
test: add fixed locale in server
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Feb 12, 2023
1 parent 59e7b8e commit 8f12643
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion playground/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ const locale = process.server ? 'en-US' : 'en-GB'
<br>
<NuxtTime :datetime="new Date()" second="numeric" month="long" day="numeric" />
<br>
<NuxtTime data-test-fixed datetime="2023-02-11T08:24:08.396Z" month="long" day="numeric" />
<NuxtTime data-test-fixed datetime="2023-02-11T08:24:08.396Z" month="long" day="numeric" :locale="locale" />
</div>
</template>
2 changes: 1 addition & 1 deletion test/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('nuxt-time', async () => {
it('ssr', async () => {
const html = await $fetch('/')
const snap = html.match(/<time[^>]*data-test-fixed[^>]*>([^<]*)<\/time>/)?.[0]
expect(snap).toMatchInlineSnapshot('"<time data-n-time data-month=\\"long\\" data-day=\\"numeric\\" datetime=\\"2023-02-11T08:24:08.396Z\\" data-test-fixed>11 February</time>"')
expect(snap).toMatchInlineSnapshot('"<time data-n-time data-month=\\"long\\" data-day=\\"numeric\\" data-locale=\\"en-US\\" datetime=\\"2023-02-11T08:24:08.396Z\\" data-test-fixed>February 11</time>"')
})

it('injects one script', async () => {
Expand Down

0 comments on commit 8f12643

Please sign in to comment.