diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_acceleration_management/flyout_modules/acceleration_details_tab.test.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_acceleration_management/flyout_modules/acceleration_details_tab.test.tsx index 31e985f388c8..faa7205d3fab 100644 --- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_acceleration_management/flyout_modules/acceleration_details_tab.test.tsx +++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_acceleration_management/flyout_modules/acceleration_details_tab.test.tsx @@ -76,12 +76,12 @@ describe('AccelerationDetailsTab', () => { // Mock the Date.now() method to always return a specific timestamp jest.spyOn(Date, 'now').mockImplementation(() => 1627819985000); // 2021-08-01T11:53:05.000Z - // Mock the Intl.DateTimeFormat to use a specific timezone (e.g., UTC-5) + // Mock the Intl.DateTimeFormat to use a specific timezone (e.g., UTC) jest.spyOn(Intl, 'DateTimeFormat').mockImplementation(() => { return { format: (date) => new Date(date).toLocaleString('en-US', { - timeZone: 'America/New_York', + timeZone: 'UTC', year: 'numeric', month: 'numeric', day: 'numeric', diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_associated_object_management/associated_objects_tab.test.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_associated_object_management/associated_objects_tab.test.tsx index b79ef6a5926e..661e219dcfa4 100644 --- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_associated_object_management/associated_objects_tab.test.tsx +++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/direct_query_associated_object_management/associated_objects_tab.test.tsx @@ -99,6 +99,23 @@ describe('AssociatedObjectsTab', () => { global.Date = OriginalDate; }); + // Mock the Intl.DateTimeFormat to use UTC for consistency + jest.spyOn(Intl, 'DateTimeFormat').mockImplementation(() => { + return { + format: (date) => + new Date(date).toLocaleString('en-US', { + timeZone: 'UTC', + year: 'numeric', + month: 'numeric', + day: 'numeric', + hour: 'numeric', + minute: 'numeric', + second: 'numeric', + hour12: true, + }), + } as any; + }); + test('renders without crashing', () => { renderComponent(); expect(