diff --git a/package.json b/package.json index 9a79374f7b4..3a5b2027b34 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,9 @@ "lint-staged": "lint-staged", "lint": "cross-env WORKSPACE_RUN_FAIL=no-bail talend-yarn-workspace run lint", "lint-merge-report": "talend-yarn-workspace lint-merge-report", - "test": "cross-env TZ=Europe/Paris talend-yarn-workspace run test --silent", - "test:update": "cross-env TZ=Europe/Paris yarn workspaces run test --silent -u", - "test:cov": "cross-env TZ=Europe/Paris talend-yarn-workspace run test:cov", + "test": "cross-env TZ=UTC talend-yarn-workspace run test --silent", + "test:update": "cross-env TZ=UTC yarn workspaces run test --silent -u", + "test:cov": "cross-env TZ=UTC talend-yarn-workspace run test:cov", "test:demo": "talend-yarn-workspace run test:demo", "test:cron": "talend-yarn-workspace run test:cron", "start-components": "yarn workspace @talend/react-components run start", diff --git a/packages/components/package.json b/packages/components/package.json index 31995f1cae3..81f171a7dc7 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -10,9 +10,9 @@ "pre-release": "yarn build:dev && yarn build:prod", "build:lib": "talend-scripts build && yarn run tsc", "tsc": "tsc --emitDeclarationOnly --project ./tsconfig.json --outDir ./types", - "test": "cross-env TZ=Europe/Paris talend-scripts test", - "test:watch": "cross-env TZ=Europe/Paris talend-scripts test --watch", - "test:cov": "cross-env TZ=Europe/Paris talend-scripts test --coverage", + "test": "cross-env TZ=UTC talend-scripts test", + "test:watch": "cross-env TZ=UTC talend-scripts test --watch", + "test:cov": "cross-env TZ=UTC talend-scripts test --coverage", "lint": "talend-scripts lint", "start": "talend-scripts start -p 6006", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js" diff --git a/packages/components/src/DateTimePickers/Date/Manager/Manager.component.test.js b/packages/components/src/DateTimePickers/Date/Manager/Manager.component.test.js index 74e27f626fa..20281309988 100644 --- a/packages/components/src/DateTimePickers/Date/Manager/Manager.component.test.js +++ b/packages/components/src/DateTimePickers/Date/Manager/Manager.component.test.js @@ -50,7 +50,7 @@ describe('Date.Manager', () => { expect(props).toEqual({ value: { textInput: '2017-04-04', - date: '2017-04-03T22:00:00.000Z', + date: '2017-04-04T00:00:00.000Z', }, inputManagement: { placeholder: 'YYYY-MM-DD', @@ -79,7 +79,7 @@ describe('Date.Manager', () => { name: 'should init state from props', initialDate: new Date(2015, 3, 4), expectedTextInput: '2015-04-04', - expectedDate: '2015-04-03T22:00:00.000Z', + expectedDate: '2015-04-04T00:00:00.000Z', }, ])('$name', ({ initialDate, expectedTextInput, expectedDate }) => { // when @@ -115,7 +115,7 @@ describe('Date.Manager', () => { initialDate: new Date(), newDate: new Date(2015, 3, 4), expectedTextInput: '2015-04-04', - expectedDate: '2015-04-03T22:00:00.000Z', + expectedDate: '2015-04-04T00:00:00.000Z', }, ])('$name', ({ initialDate, newDate, expectedTextInput, expectedDate }) => { // given @@ -176,7 +176,7 @@ describe('Date.Manager', () => { { name: 'with valid date', textInput: '2015-01-15', - expectedDate: '2015-01-14T23:00:00.000Z', + expectedDate: '2015-01-15T00:00:00.000Z', }, { name: 'with invalid date', @@ -191,7 +191,7 @@ describe('Date.Manager', () => { { name: 'with custom date format', textInput: '15/01/2015', - expectedDate: '2015-01-14T23:00:00.000Z', + expectedDate: '2015-01-15T00:00:00.000Z', dateFormat: 'DD/MM/YYYY', }, ])('$name', async ({ textInput, expectedDate, dateFormat }) => { diff --git a/packages/components/src/DateTimePickers/Date/Picker/Picker.component.test.js b/packages/components/src/DateTimePickers/Date/Picker/Picker.component.test.js index 9fa9f835d5b..551e0eea406 100644 --- a/packages/components/src/DateTimePickers/Date/Picker/Picker.component.test.js +++ b/packages/components/src/DateTimePickers/Date/Picker/Picker.component.test.js @@ -32,7 +32,7 @@ describe('Date.Picker', () => { expect(props).toMatchObject({ manageFocus: true, other: 'custom props', - selectedDate: '2007-01-01T23:00:00.000Z', + selectedDate: '2007-01-02T00:00:00.000Z', useUTC: false, }); }); diff --git a/packages/components/src/DateTimePickers/Date/date-extraction.test.js b/packages/components/src/DateTimePickers/Date/date-extraction.test.js index 1e3d2c7bb44..e0126163778 100644 --- a/packages/components/src/DateTimePickers/Date/date-extraction.test.js +++ b/packages/components/src/DateTimePickers/Date/date-extraction.test.js @@ -273,7 +273,7 @@ describe('Date extraction', () => { // then expect(parts).toEqual({ localDate: new Date(2018, 11, 25), - date: subHours(new Date(2018, 11, 25), 8), + date: subHours(new Date(2018, 11, 25), 9), textInput, errorMessage: null, errors: [], @@ -325,7 +325,7 @@ describe('Date extraction', () => { const date = extractDateOnly(datetime, options); // then - expect(date).toEqual(new Date(2019, 8, 25)); + expect(date).toEqual(new Date(2019, 8, 26)); }); it('should extract date when timezone provided', () => { // given diff --git a/packages/components/src/DateTimePickers/DateRange/Manager/Manager.component.test.js b/packages/components/src/DateTimePickers/DateRange/Manager/Manager.component.test.js index cde6bdbdfa9..be2a45313cd 100644 --- a/packages/components/src/DateTimePickers/DateRange/Manager/Manager.component.test.js +++ b/packages/components/src/DateTimePickers/DateRange/Manager/Manager.component.test.js @@ -51,11 +51,11 @@ describe('DateRange.Manager', () => { const consumer = screen.getByTestId('DateRangeConsumerDiv'); const props = JSON.parse(consumer.getAttribute('data-props')); expect(props.startDate).toEqual({ - value: '2017-04-03T22:00:00.000Z', + value: '2017-04-04T00:00:00.000Z', textInput: '2017-04-04', }); expect(props.endDate).toEqual({ - value: '2017-04-09T22:00:00.000Z', + value: '2017-04-10T00:00:00.000Z', textInput: '2017-04-10', }); }); diff --git a/packages/components/src/DateTimePickers/DateTime/datetime-extraction.test.js b/packages/components/src/DateTimePickers/DateTime/datetime-extraction.test.js index 70f0e69514d..24886754492 100644 --- a/packages/components/src/DateTimePickers/DateTime/datetime-extraction.test.js +++ b/packages/components/src/DateTimePickers/DateTime/datetime-extraction.test.js @@ -166,8 +166,8 @@ describe('Date extraction', () => { // then expect(parts).toEqual({ - date: new Date(2015, 8, 14), - time: { hours: '23', minutes: '00', seconds: '22' }, + date: new Date(2015, 8, 15), + time: { hours: '01', minutes: '00', seconds: '22' }, datetime: new Date(2015, 8, 15, 1, 0, 22), }); }); diff --git a/packages/components/src/DateTimePickers/LegacyDateTimePickers/DateTime/date-extraction.test.js b/packages/components/src/DateTimePickers/LegacyDateTimePickers/DateTime/date-extraction.test.js index bf5778d3cf2..e1ba81c13e2 100644 --- a/packages/components/src/DateTimePickers/LegacyDateTimePickers/DateTime/date-extraction.test.js +++ b/packages/components/src/DateTimePickers/LegacyDateTimePickers/DateTime/date-extraction.test.js @@ -248,11 +248,11 @@ describe('Date extraction', () => { // then expect(parts).toEqual({ - date: new Date(2015, 8, 14), + date: new Date(2015, 8, 15, 0, 0, 0), datetime: validDate, - textInput: '2015-09-14 23:00:22', + textInput: '2015-09-15 01:00:22', errors: [], - time: { hours: '23', minutes: '00', seconds: '22' }, + time: { hours: '01', minutes: '00', seconds: '22' }, }); }); }); @@ -435,7 +435,7 @@ describe('Date extraction', () => { // then expect(parts).toEqual({ date, - datetime: new Date(2015, 8, 15, 14, 58, 22), + datetime: new Date(2015, 8, 15, 12, 58, 22), textInput: '2015-09-15 12:58:22', time, errorMessage: null, @@ -668,7 +668,7 @@ describe('Date extraction', () => { expect(parts).toEqual({ date: new Date(2018, 11, 25), time: { hours: '22', minutes: '58', seconds: '12' }, - datetime: new Date(2018, 11, 25, 23, 58, 12), + datetime: new Date(2018, 11, 25, 22, 58, 12), textInput, errorMessage: null, errors: [], diff --git a/packages/components/src/VirtualizedList/CellDatetime/CellDatetime.test.js b/packages/components/src/VirtualizedList/CellDatetime/CellDatetime.test.js index 1c823b1dcd9..43581196f68 100644 --- a/packages/components/src/VirtualizedList/CellDatetime/CellDatetime.test.js +++ b/packages/components/src/VirtualizedList/CellDatetime/CellDatetime.test.js @@ -126,10 +126,7 @@ describe('CellDatetime', () => { const timezoneOffset = new Date(cellData).getTimezoneOffset(); const cellDataWithOffset = cellData + timezoneOffset * 60 * 1000; const hours = 11 + timezoneOffset / 60; - const isOneDigitHours = hours.toString().length === 1; - const expectedStrDate = `2016-09-22 ${isOneDigitHours ? 0 : ''}${ - 11 + timezoneOffset / 60 - }:00:00`; + const expectedStrDate = '2016-09-22 09:00:00'; const computedStrOffset = computeValue(cellDataWithOffset, columnData, t); // then expect(computedStrOffset).toEqual(expectedStrDate); diff --git a/packages/dataviz/package.json b/packages/dataviz/package.json index 1da687650bc..2d3d5b3e63d 100644 --- a/packages/dataviz/package.json +++ b/packages/dataviz/package.json @@ -15,10 +15,10 @@ "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", "lint": "talend-scripts lint", "start": "talend-scripts start-storybook -p 6006", - "test": "cross-env TZ=Europe/Paris talend-scripts test", + "test": "cross-env TZ=UTC talend-scripts test", "test:cy": "cypress run --component --spec **.cy.tsx", - "test:watch": "cross-env TZ=Europe/Paris talend-scripts test --watch", - "test:cov": "cross-env TZ=Europe/Paris talend-scripts test --coverage" + "test:watch": "cross-env TZ=UTC talend-scripts test --watch", + "test:cov": "cross-env TZ=UTC talend-scripts test --coverage" }, "keywords": [ "react", diff --git a/packages/dataviz/src/components/RangeFilter/handlers/DateRangeHandler/DateRangeHandler.test.tsx b/packages/dataviz/src/components/RangeFilter/handlers/DateRangeHandler/DateRangeHandler.test.tsx index 961b0a6bb41..cb90c7e9745 100755 --- a/packages/dataviz/src/components/RangeFilter/handlers/DateRangeHandler/DateRangeHandler.test.tsx +++ b/packages/dataviz/src/components/RangeFilter/handlers/DateRangeHandler/DateRangeHandler.test.tsx @@ -81,8 +81,8 @@ describe('DateRangeHandler', () => { const ticks = DateRangeHandler.getTicks(limits); expect(ticks).toEqual({ [limits.min]: '2000-01-01', - '1262300400000': '2010-01-01', - '1577833200000': '2020-01-01', + '1262304000000': '2010-01-01', + '1577836800000': '2020-01-01', [limits.max]: '2030-01-01', }); }); diff --git a/packages/dataviz/src/components/RangeFilter/handlers/DateTimeRangeHandler/DateTimeRangeHandler.test.tsx b/packages/dataviz/src/components/RangeFilter/handlers/DateTimeRangeHandler/DateTimeRangeHandler.test.tsx index b4502b7cc78..60393cea77c 100755 --- a/packages/dataviz/src/components/RangeFilter/handlers/DateTimeRangeHandler/DateTimeRangeHandler.test.tsx +++ b/packages/dataviz/src/components/RangeFilter/handlers/DateTimeRangeHandler/DateTimeRangeHandler.test.tsx @@ -43,7 +43,7 @@ describe('DateTimeRangeHandler', () => { fireEvent.click(screen.getByText('InputDateTimePicker.onChange 1')); fireEvent.keyDown(screen.getByRole('textbox'), { key: 'Escape' }); - expect(screen.getByRole('textbox')).toHaveValue('2010-01-01 00:00:00'); + expect(screen.getByRole('textbox')).toHaveValue('2009-12-31 23:00:00'); }); it('Should reset value on blur with invalid input', () => { @@ -82,8 +82,8 @@ describe('DateTimeRangeHandler', () => { const ticks = DateRangeHandler.getTicks(limits); expect(ticks).toEqual({ [limits.min]: '2000-01-01', - '1262300400000': '2010-01-01', - '1577833200000': '2020-01-01', + '1262304000000': '2010-01-01', + '1577836800000': '2020-01-01', [limits.max]: '2030-01-01', }); }); diff --git a/packages/faceted-search/package.json b/packages/faceted-search/package.json index 5019a10d3fd..745e05a8d3b 100644 --- a/packages/faceted-search/package.json +++ b/packages/faceted-search/package.json @@ -10,9 +10,9 @@ "build:prod": "talend-scripts build --umd --prod", "pre-release": "yarn build:dev && yarn build:prod", "build:lib": "talend-scripts build", - "test": "cross-env TZ=Europe/Paris talend-scripts test", - "test:watch": "cross-env TZ=Europe/Paris talend-scripts test --watch", - "test:cov": "cross-env TZ=Europe/Paris talend-scripts test --coverage", + "test": "cross-env TZ=UTC talend-scripts test", + "test:watch": "cross-env TZ=UTC talend-scripts test --watch", + "test:cov": "cross-env TZ=UTC talend-scripts test --coverage", "test:demo": "talend-scripts build-storybook --quiet --docs", "lint": "talend-scripts lint ./src/**/*.js ./stories/**/*.js ./.storybook/**/*.js", "start": "talend-scripts start-storybook -p 6006", diff --git a/packages/forms/package.json b/packages/forms/package.json index 028da542ad8..e4689eae8bf 100644 --- a/packages/forms/package.json +++ b/packages/forms/package.json @@ -11,7 +11,7 @@ "build-storybook": "talend-scripts build-storybook", "pre-release": "yarn build:dev && yarn build:prod", "build:lib": "talend-scripts build", - "test": "cross-env TZ=Europe/Paris talend-scripts test", + "test": "cross-env TZ=UTC talend-scripts test", "test:watch": "talend-scripts test --watch", "test:cov": "talend-scripts test --coverage", "lint": "talend-scripts lint", diff --git a/packages/forms/src/UIForm/fields/Date/Date.component.test.js b/packages/forms/src/UIForm/fields/Date/Date.component.test.js index a2e480122aa..1d12fa823f9 100644 --- a/packages/forms/src/UIForm/fields/Date/Date.component.test.js +++ b/packages/forms/src/UIForm/fields/Date/Date.component.test.js @@ -158,7 +158,7 @@ describe('Date widget', () => { // then expect(onChange).toBeCalledWith(expect.anything(event), { schema: timestampSchema, - value: 1442786400000, + value: 1442793600000, }); }); @@ -227,7 +227,7 @@ describe('Date widget', () => { // then expect(onChange).toBeCalledWith(expect.anything(event), { schema: isoSchema, - value: '2015-09-20T22:00:00.000Z', + value: '2015-09-21T00:00:00.000Z', }); }); diff --git a/packages/forms/src/UIForm/fields/Date/DateTime.component.test.js b/packages/forms/src/UIForm/fields/Date/DateTime.component.test.js index 54c012796fc..13ea95179cd 100644 --- a/packages/forms/src/UIForm/fields/Date/DateTime.component.test.js +++ b/packages/forms/src/UIForm/fields/Date/DateTime.component.test.js @@ -54,7 +54,7 @@ describe('DateTime widget', () => { }); // then expect(screen.getAllByRole('textbox')[0]).toHaveValue('2018-01-01'); - expect(screen.getAllByRole('textbox')[1]).toHaveValue('11:35'); + expect(screen.getAllByRole('textbox')[1]).toHaveValue('10:35'); }); it('should trigger onFinish on picker blur', async () => { // given @@ -121,7 +121,7 @@ describe('DateTime widget', () => { expect(props.onChange.mock.calls[1][1]).toMatchObject({ schema: timestampSchema, - value: new Date(2015, 8, 21, 2, 30, 0).getTime(), + value: new Date(2015, 8, 21, 1, 30, 0).getTime(), }); }); diff --git a/packages/stepper/package.json b/packages/stepper/package.json index 469c492b50e..476844745fa 100644 --- a/packages/stepper/package.json +++ b/packages/stepper/package.json @@ -11,10 +11,10 @@ "pre-release": "yarn build:dev && yarn build:prod", "build:lib": "talend-scripts build", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", - "test": "cross-env TZ=Europe/Paris talend-scripts test", - "test:noisy": "cross-env TZ=Europe/Paris talend-scripts test", - "test:watch": "cross-env TZ=Europe/Paris talend-scripts test --watch", - "test:cov": "cross-env TZ=Europe/Paris talend-scripts test --coverage", + "test": "cross-env TZ=UTC talend-scripts test", + "test:noisy": "cross-env TZ=UTC talend-scripts test", + "test:watch": "cross-env TZ=UTC talend-scripts test --watch", + "test:cov": "cross-env TZ=UTC talend-scripts test --coverage", "lint": "talend-scripts lint", "start": "talend-scripts start-storybook -p 6006" }, diff --git a/packages/utils/package.json b/packages/utils/package.json index 85b59df99d1..4ab3634e889 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -13,10 +13,10 @@ "scripts": { "build:lib": "talend-scripts build", "lint": "talend-scripts lint", - "test": "cross-env TZ=Europe/Paris talend-scripts test", - "test:cov": "cross-env TZ=Europe/Paris talend-scripts test --coverage --silent", - "test:noisy": "cross-env TZ=Europe/Paris talend-scripts test", - "test:watch": "cross-env TZ=Europe/Paris talend-scripts test --watch", + "test": "cross-env TZ=UTC talend-scripts test", + "test:cov": "cross-env TZ=UTC talend-scripts test --coverage --silent", + "test:noisy": "cross-env TZ=UTC talend-scripts test", + "test:watch": "cross-env TZ=UTC talend-scripts test --watch", "extends": "talend-scripts extends" }, "devDependencies": { diff --git a/packages/utils/src/date/date.test.ts b/packages/utils/src/date/date.test.ts index 725dcfce1ba..6317c38ff4d 100644 --- a/packages/utils/src/date/date.test.ts +++ b/packages/utils/src/date/date.test.ts @@ -42,7 +42,7 @@ describe('date', () => { const localDate = convertToLocalTime(dateObj, options); // then - expect(localDate).toEqual(new Date('2020-05-13, 17:00')); + expect(localDate).toEqual(new Date('2020-05-13, 15:00')); }); it('should convert a date string of a timezone to the locale timezone', () => { @@ -54,7 +54,7 @@ describe('date', () => { const localDate = convertToLocalTime(dateObj, options); // then - expect(localDate).toEqual(new Date('2020-05-14, 01:00')); + expect(localDate).toEqual(new Date('2020-05-13, 23:00')); }); }); @@ -68,7 +68,7 @@ describe('date', () => { const localDate = convertToTimeZone(dateObj, options); // then - expect(localDate).toEqual(new Date('2020-05-13, 23:00')); + expect(localDate).toEqual(new Date('2020-05-14, 01:00')); }); it('should convert a locale date string to the given timezone time', () => { @@ -80,7 +80,7 @@ describe('date', () => { const localDate = convertToTimeZone(dateObj, options); // then - expect(localDate).toEqual(new Date('2020-05-13, 15:00')); + expect(localDate).toEqual(new Date('2020-05-13, 17:00')); }); it('should convert a date from a specific timezone to the target timezone time', () => { @@ -120,7 +120,7 @@ describe('date', () => { const localDate = formatToTimeZone(dateObj, formatString, options); // then - expect(localDate).toEqual('2020-05-13T23:00:00+0500'); + expect(localDate).toEqual('2020-05-14T01:00:00+0500'); }); it('should not change timezone tokens that are wrapped in hooks', () => { @@ -133,7 +133,7 @@ describe('date', () => { const localDate = formatToTimeZone(dateObj, formatString, options); // then - expect(localDate).toEqual('2020-05-13T23:00:00Z'); + expect(localDate).toEqual('2020-05-14T01:00:00Z'); }); it('should pass locale to datefns format method', () => { // given