From 9dddf5322f69787e53e369cb9291c56ff3e0184c Mon Sep 17 00:00:00 2001 From: Marco Schumacher Date: Thu, 30 Sep 2021 09:49:27 +0200 Subject: [PATCH] fix: date test --- test/react.test.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/react.test.tsx b/test/react.test.tsx index 36c4fd4..c1f93bf 100644 --- a/test/react.test.tsx +++ b/test/react.test.tsx @@ -45,7 +45,7 @@ function HookWrapper({ return <>{value instanceof Array ? value.join('') : value}; } -const date = new Date(2000, 0, 1, 0, 0, 0, 0); +const date = new Date('2000-01-01T00:00:00Z'); const forCases = ( name: string, @@ -101,10 +101,10 @@ forCases( 'with complex values', (t) => t('nested.key3', { number: 1, plural: 1, selectordinal: 1, date, time: date }), async (t, div) => { - t.is(div.textContent, 'key3:en 1 one 1st 1/1/2000 12:00 AM'); + t.is(div.textContent, 'key3:en 1 one 1st 1/1/2000 1:00 AM'); fireEvent.click(div); - t.is(div.textContent, 'key3:de 1 eins 1te 1.1.2000 00:00'); + t.is(div.textContent, 'key3:de 1 eins 1te 1.1.2000 01:00'); }, ); @@ -169,12 +169,12 @@ forCases( forCases( 'dateTimeFormat', - (t) => t.dateTimeFormat(new Date(0), { dateStyle: 'short', timeStyle: 'long' }), + (t) => t.dateTimeFormat(date, { dateStyle: 'short', timeStyle: 'short' }), async (t, div) => { - t.is(div.textContent, '1/1/70, 1:00:00 AM GMT+1'); + t.is(div.textContent, '1/1/00, 1:00 AM'); fireEvent.click(div); - t.is(div.textContent, '01.01.70, 01:00:00 MEZ'); + t.is(div.textContent, '01.01.00, 01:00'); }, );