From 100e4eae24278fd01d80de5cc97a978f31bceba0 Mon Sep 17 00:00:00 2001 From: akintomiwa Date: Mon, 19 Aug 2024 11:00:54 +0000 Subject: [PATCH 01/12] Change DLS datafile createTime to datafileCreateTime --- .../src/views/table/dls/dlsDatafilesTable.component.tsx | 2 +- .../src/views/table/isis/isisDatafilesTable.component.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.tsx b/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.tsx index b0bcfc224..31a20824d 100644 --- a/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.tsx +++ b/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.tsx @@ -134,7 +134,7 @@ const DLSDatafilesTable = ( { icon: CalendarToday, label: t('datafiles.create_time'), - dataKey: 'createTime', + dataKey: 'datafileCreateTime', filterComponent: dateFilter, defaultSort: 'desc', }, diff --git a/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.tsx b/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.tsx index bb70f301f..0ec09ca32 100644 --- a/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.tsx +++ b/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.tsx @@ -150,7 +150,7 @@ const ISISDatafilesTable = ( { icon: CalendarTodayIcon, label: t('datafiles.modified_time'), - dataKey: 'modTime', + dataKey: 'datafileModTime', filterComponent: dateFilter, defaultSort: 'desc', }, From 51e10e63de18cfb83b136f6e8b263bdb2c9f1d39 Mon Sep 17 00:00:00 2001 From: akintomiwa Date: Mon, 19 Aug 2024 13:08:46 +0000 Subject: [PATCH 02/12] Datafile interface update --- packages/datagateway-common/src/app.types.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/datagateway-common/src/app.types.tsx b/packages/datagateway-common/src/app.types.tsx index c0aa16104..3239d5353 100644 --- a/packages/datagateway-common/src/app.types.tsx +++ b/packages/datagateway-common/src/app.types.tsx @@ -64,8 +64,8 @@ export interface Dataset { export interface Datafile { id: number; name: string; - modTime: string; - createTime: string; + datafileModTime: string; + datafileCreateTime: string; fileSize?: number; location?: string; description?: string; From f4626a673fb0962d3ef5a146cb876b0deef52ad2 Mon Sep 17 00:00:00 2001 From: akintomiwa Date: Mon, 19 Aug 2024 13:08:57 +0000 Subject: [PATCH 03/12] tests update --- .../src/views/table/dls/dlsDatafilesTable.component.test.tsx | 2 +- .../views/table/isis/isisDatafilesTable.component.test.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx b/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx index 7ff367e8f..5d9da603f 100644 --- a/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx +++ b/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx @@ -209,7 +209,7 @@ describe('DLS datafiles table component', () => { expect(history.length).toBe(2); expect(history.location.search).toBe( `?filters=${encodeURIComponent( - '{"createTime":{"endDate":"2019-08-06"}}' + '{"datafileCreateTime":{"endDate":"2019-08-06"}}' )}` ); diff --git a/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx b/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx index 0c68b3a33..88b5c0955 100644 --- a/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx +++ b/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx @@ -244,7 +244,7 @@ describe('ISIS datafiles table component', () => { expect(history.length).toBe(2); expect(history.location.search).toBe( - `?filters=${encodeURIComponent('{"modTime":{"endDate":"2019-08-06"}}')}` + `?filters=${encodeURIComponent('{"datafileModTime":{"endDate":"2019-08-06"}}')}` ); // await user.clear(filterInput); @@ -262,7 +262,7 @@ describe('ISIS datafiles table component', () => { renderComponent(); expect(history.length).toBe(1); expect(history.location.search).toBe( - `?sort=${encodeURIComponent('{"modTime":"desc"}')}` + `?sort=${encodeURIComponent('{"datafileModTime":"desc"}')}` ); // check that the data request is sent only once after mounting From f95d08fdc70fc46738831f0e8a4b95ef15549dea Mon Sep 17 00:00:00 2001 From: akintomiwa Date: Mon, 19 Aug 2024 13:31:17 +0000 Subject: [PATCH 04/12] tests update 2 --- .../views/table/dls/dlsDatafilesTable.component.test.tsx | 6 +++--- .../views/table/isis/isisDatafilesTable.component.test.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx b/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx index 5d9da603f..df6f781da 100644 --- a/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx +++ b/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx @@ -78,8 +78,8 @@ describe('DLS datafiles table component', () => { name: 'Test 1', location: '/test1', fileSize: 1, - modTime: '2019-07-23', - createTime: '2019-07-23', + datafileModTime: '2019-07-23', + datafileCreateTime: '2019-07-23', }, ]; history = createMemoryHistory(); @@ -228,7 +228,7 @@ describe('DLS datafiles table component', () => { renderComponent(); expect(history.length).toBe(1); expect(history.location.search).toBe( - `?sort=${encodeURIComponent('{"createTime":"desc"}')}` + `?sort=${encodeURIComponent('{"datafileCreateTime":"desc"}')}` ); // check that the data request is sent only once after mounting diff --git a/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx b/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx index 88b5c0955..10258499b 100644 --- a/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx +++ b/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx @@ -61,8 +61,8 @@ describe('ISIS datafiles table component', () => { name: 'Test 1', location: '/test1', fileSize: 1, - modTime: '2019-07-23', - createTime: '2019-07-23', + datafileModTime: '2019-07-23', + datafileCreateTime: '2019-07-23', }, ]; cartItems = []; From df874a28e7fa753be496c162140307852541a5d5 Mon Sep 17 00:00:00 2001 From: akintomiwa Date: Tue, 20 Aug 2024 11:42:45 +0000 Subject: [PATCH 05/12] datafile table component update --- .../src/views/table/datafileTable.component.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/datagateway-dataview/src/views/table/datafileTable.component.tsx b/packages/datagateway-dataview/src/views/table/datafileTable.component.tsx index 2936db152..d1d2bc2ce 100644 --- a/packages/datagateway-dataview/src/views/table/datafileTable.component.tsx +++ b/packages/datagateway-dataview/src/views/table/datafileTable.component.tsx @@ -122,7 +122,7 @@ const DatafileTable = (props: DatafileTableProps): React.ReactElement => { { icon: CalendarToday, label: t('datafiles.modified_time'), - dataKey: 'modTime', + dataKey: 'datafileModTime', filterComponent: dateFilter, }, ], From fb94bc3ff699a273cf2a60e70764a4f8e42f01e8 Mon Sep 17 00:00:00 2001 From: akintomiwa Date: Tue, 20 Aug 2024 11:43:59 +0000 Subject: [PATCH 06/12] test data update - dataview, download --- .../src/views/datafilePreview/testData.ts | 4 ++-- packages/datagateway-download/src/testData.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/datagateway-dataview/src/views/datafilePreview/testData.ts b/packages/datagateway-dataview/src/views/datafilePreview/testData.ts index 630f75a39..f92c8e134 100644 --- a/packages/datagateway-dataview/src/views/datafilePreview/testData.ts +++ b/packages/datagateway-dataview/src/views/datafilePreview/testData.ts @@ -3,13 +3,13 @@ import type { Datafile } from 'datagateway-common'; const mockDatafile = { - createTime: '2020-01-01', + datafileCreateTime: '2020-01-01', dataset: undefined, description: 'test description', fileSize: 100, id: 123, location: 'test location', - modTime: '2020-01-02', + datafileModTime: '2020-01-02', name: 'Datafile.txt', parameters: [], } satisfies Datafile; diff --git a/packages/datagateway-download/src/testData.ts b/packages/datagateway-download/src/testData.ts index 5e229ddb1..fd4dc6b10 100644 --- a/packages/datagateway-download/src/testData.ts +++ b/packages/datagateway-download/src/testData.ts @@ -323,8 +323,8 @@ export const mockDatafiles: Datafile[] = [ { id: 70, name: 'datafile weekend', - modTime: '2018-03-10T08:19:55Z', - createTime: '2018-03-10T08:19:55Z', + datafileModTime: '2018-03-10T08:19:55Z', + datafileCreateTime: '2018-03-10T08:19:55Z', dataset: mockDatasets[0], }, ]; From 27a06a669af562acaf243733e723ded453bd0fcc Mon Sep 17 00:00:00 2001 From: akintomiwa Date: Tue, 20 Aug 2024 11:44:40 +0000 Subject: [PATCH 07/12] ISIS datafile table test update --- .../views/table/isis/isisDatafilesTable.component.test.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx b/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx index 10258499b..144941130 100644 --- a/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx +++ b/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx @@ -244,7 +244,9 @@ describe('ISIS datafiles table component', () => { expect(history.length).toBe(2); expect(history.location.search).toBe( - `?filters=${encodeURIComponent('{"datafileModTime":{"endDate":"2019-08-06"}}')}` + `?filters=${encodeURIComponent( + '{"datafileModTime":{"endDate":"2019-08-06"}}' + )}` ); // await user.clear(filterInput); From 7a8b8575860c17265b9a26d8cbbb9c169ab00edc Mon Sep 17 00:00:00 2001 From: akintomiwa Date: Tue, 20 Aug 2024 11:46:16 +0000 Subject: [PATCH 08/12] details pane table component update --- .../src/views/datafilePreview/detailsPane.component.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.tsx b/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.tsx index b8c3d9879..7dcc139a2 100644 --- a/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.tsx +++ b/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.tsx @@ -53,11 +53,11 @@ function DetailsPane(): JSX.Element { /> From 6fb75938eb99fb19fc201734098fb2b18f22ff3c Mon Sep 17 00:00:00 2001 From: akintomiwa Date: Tue, 20 Aug 2024 11:46:25 +0000 Subject: [PATCH 09/12] details pane table test update --- .../views/datafilePreview/detailsPane.component.test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.test.tsx b/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.test.tsx index 8c17d210b..763c8086c 100644 --- a/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.test.tsx +++ b/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.test.tsx @@ -96,14 +96,14 @@ describe('DetailsPane', () => { expect( await screen.findByText('datafiles.details.mod_time') ).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.modTime)).toBeInTheDocument(); + expect(screen.getByText(mockDatafile.datafileModTime)).toBeInTheDocument(); }); it('with an unknown message if the last modified time is unknown', async () => { renderComponent({ datafile: { ...mockDatafile, - modTime: '', + datafileModTime: '', }, }); @@ -121,14 +121,14 @@ describe('DetailsPane', () => { expect( await screen.findByText('datafiles.details.create_time') ).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.createTime)).toBeInTheDocument(); + expect(screen.getByText(mockDatafile.datafileCreateTime)).toBeInTheDocument(); }); it('with an unknown message if the creation date is unknown', async () => { renderComponent({ datafile: { ...mockDatafile, - createTime: '', + datafileCreateTime: '', }, }); From 3e85a7b8a07c3dd7c0cde1b6bed65295bdad87bf Mon Sep 17 00:00:00 2001 From: akintomiwa Date: Tue, 20 Aug 2024 11:47:06 +0000 Subject: [PATCH 10/12] datafile previewer, table test update --- .../datafilePreviewer.component.test.tsx | 28 +++++++++---------- .../table/datafileTable.component.test.tsx | 6 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/datagateway-dataview/src/views/datafilePreview/datafilePreviewer.component.test.tsx b/packages/datagateway-dataview/src/views/datafilePreview/datafilePreviewer.component.test.tsx index a4e2eb3f2..4db7466f0 100644 --- a/packages/datagateway-dataview/src/views/datafilePreview/datafilePreviewer.component.test.tsx +++ b/packages/datagateway-dataview/src/views/datafilePreview/datafilePreviewer.component.test.tsx @@ -188,8 +188,8 @@ describe('DatafilePreviewer', () => { expect(screen.getByText(mockDatafile.location)).toBeInTheDocument(); // formatted size of the datafile expect(screen.getByText('100 B')).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.modTime)).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.createTime)).toBeInTheDocument(); + expect(screen.getByText(mockDatafile.datafileModTime)).toBeInTheDocument(); + expect(screen.getByText(mockDatafile.datafileCreateTime)).toBeInTheDocument(); }); it('should show the current progress of downloading datafile content', async () => { @@ -227,8 +227,8 @@ describe('DatafilePreviewer', () => { expect(screen.getByText(mockDatafile.location)).toBeInTheDocument(); // formatted size of the datafile expect(screen.getByText('100 B')).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.modTime)).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.createTime)).toBeInTheDocument(); + expect(screen.getByText(mockDatafile.datafileModTime)).toBeInTheDocument(); + expect(screen.getByText(mockDatafile.datafileCreateTime)).toBeInTheDocument(); }); it('should show a message saying the datafile cannot be previewed if the datafile extension is not supported', async () => { @@ -260,9 +260,9 @@ describe('DatafilePreviewer', () => { expect(screen.getByText(unsupportedDatafile.location)).toBeInTheDocument(); // formatted size of the datafile expect(screen.getByText('100 B')).toBeInTheDocument(); - expect(screen.getByText(unsupportedDatafile.modTime)).toBeInTheDocument(); + expect(screen.getByText(unsupportedDatafile.datafileModTime)).toBeInTheDocument(); expect( - screen.getByText(unsupportedDatafile.createTime) + screen.getByText(unsupportedDatafile.datafileCreateTime) ).toBeInTheDocument(); }); @@ -295,9 +295,9 @@ describe('DatafilePreviewer', () => { expect(screen.getByText(unsupportedDatafile.location)).toBeInTheDocument(); // formatted size of the datafile expect(screen.getByText('100 B')).toBeInTheDocument(); - expect(screen.getByText(unsupportedDatafile.modTime)).toBeInTheDocument(); + expect(screen.getByText(unsupportedDatafile.datafileModTime)).toBeInTheDocument(); expect( - screen.getByText(unsupportedDatafile.createTime) + screen.getByText(unsupportedDatafile.datafileCreateTime) ).toBeInTheDocument(); }); @@ -328,8 +328,8 @@ describe('DatafilePreviewer', () => { expect(screen.getByText(mockDatafile.location)).toBeInTheDocument(); // formatted size of the datafile expect(screen.getByText('100 B')).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.modTime)).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.createTime)).toBeInTheDocument(); + expect(screen.getByText(mockDatafile.datafileModTime)).toBeInTheDocument(); + expect(screen.getByText(mockDatafile.datafileCreateTime)).toBeInTheDocument(); }); it('hides the details pane when it is switched off', async () => { @@ -353,8 +353,8 @@ describe('DatafilePreviewer', () => { expect(screen.queryByText(mockDatafile.location)).toBeNull(); // formatted size of the datafile expect(screen.queryByText('100 B')).toBeNull(); - expect(screen.queryByText(mockDatafile.modTime)).toBeNull(); - expect(screen.queryByText(mockDatafile.createTime)).toBeNull(); + expect(screen.queryByText(mockDatafile.datafileModTime)).toBeNull(); + expect(screen.queryByText(mockDatafile.datafileCreateTime)).toBeNull(); }); }); @@ -385,8 +385,8 @@ describe('DatafilePreviewer', () => { expect(screen.getByText(mockDatafile.location)).toBeInTheDocument(); // formatted size of the datafile expect(screen.getByText('100 B')).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.modTime)).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.createTime)).toBeInTheDocument(); + expect(screen.getByText(mockDatafile.datafileModTime)).toBeInTheDocument(); + expect(screen.getByText(mockDatafile.datafileCreateTime)).toBeInTheDocument(); }); }); diff --git a/packages/datagateway-dataview/src/views/table/datafileTable.component.test.tsx b/packages/datagateway-dataview/src/views/table/datafileTable.component.test.tsx index 19e458114..e9a71df7c 100644 --- a/packages/datagateway-dataview/src/views/table/datafileTable.component.test.tsx +++ b/packages/datagateway-dataview/src/views/table/datafileTable.component.test.tsx @@ -63,8 +63,8 @@ describe('Datafile table component', () => { name: 'Test 1', location: '/test1', fileSize: 1, - modTime: '2019-07-23', - createTime: '2019-07-23', + datafileModTime: '2019-07-23', + datafileCreateTime: '2019-07-23', }, ]; history = createMemoryHistory(); @@ -243,7 +243,7 @@ describe('Datafile table component', () => { expect(history.length).toBe(2); expect(history.location.search).toBe( - `?filters=${encodeURIComponent('{"modTime":{"endDate":"2019-08-06"}}')}` + `?filters=${encodeURIComponent('{"datafileModTime":{"endDate":"2019-08-06"}}')}` ); // await user.clear(filterInput); From 4aa7152525b1dabf42a79e23e8c6073c6bb3ff99 Mon Sep 17 00:00:00 2001 From: Louise Davies Date: Fri, 30 Aug 2024 14:12:37 +0100 Subject: [PATCH 11/12] Add back in modTime & createTime fields --- packages/datagateway-common/src/app.types.tsx | 6 ++++-- .../datafilePreview/detailsPane.component.test.tsx | 12 ++++++++---- .../src/views/datafilePreview/testData.ts | 6 ++++-- .../src/views/table/datafileTable.component.test.tsx | 12 ++++++++---- .../table/dls/dlsDatafilesTable.component.test.tsx | 8 +++++--- .../table/isis/isisDatafilesTable.component.test.tsx | 8 +++++--- packages/datagateway-download/src/testData.ts | 4 ++-- 7 files changed, 36 insertions(+), 20 deletions(-) diff --git a/packages/datagateway-common/src/app.types.tsx b/packages/datagateway-common/src/app.types.tsx index 3239d5353..2f1cbf391 100644 --- a/packages/datagateway-common/src/app.types.tsx +++ b/packages/datagateway-common/src/app.types.tsx @@ -64,8 +64,10 @@ export interface Dataset { export interface Datafile { id: number; name: string; - datafileModTime: string; - datafileCreateTime: string; + modTime: string; + createTime: string; + datafileModTime?: string; + datafileCreateTime?: string; fileSize?: number; location?: string; description?: string; diff --git a/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.test.tsx b/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.test.tsx index 763c8086c..5116c780e 100644 --- a/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.test.tsx +++ b/packages/datagateway-dataview/src/views/datafilePreview/detailsPane.component.test.tsx @@ -96,14 +96,16 @@ describe('DetailsPane', () => { expect( await screen.findByText('datafiles.details.mod_time') ).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.datafileModTime)).toBeInTheDocument(); + expect( + screen.getByText(mockDatafile.datafileModTime) + ).toBeInTheDocument(); }); it('with an unknown message if the last modified time is unknown', async () => { renderComponent({ datafile: { ...mockDatafile, - datafileModTime: '', + datafileModTime: undefined, }, }); @@ -121,14 +123,16 @@ describe('DetailsPane', () => { expect( await screen.findByText('datafiles.details.create_time') ).toBeInTheDocument(); - expect(screen.getByText(mockDatafile.datafileCreateTime)).toBeInTheDocument(); + expect( + screen.getByText(mockDatafile.datafileCreateTime) + ).toBeInTheDocument(); }); it('with an unknown message if the creation date is unknown', async () => { renderComponent({ datafile: { ...mockDatafile, - datafileCreateTime: '', + datafileCreateTime: undefined, }, }); diff --git a/packages/datagateway-dataview/src/views/datafilePreview/testData.ts b/packages/datagateway-dataview/src/views/datafilePreview/testData.ts index f92c8e134..bae29d298 100644 --- a/packages/datagateway-dataview/src/views/datafilePreview/testData.ts +++ b/packages/datagateway-dataview/src/views/datafilePreview/testData.ts @@ -3,13 +3,15 @@ import type { Datafile } from 'datagateway-common'; const mockDatafile = { - datafileCreateTime: '2020-01-01', + createTime: '2020-01-01', + datafileCreateTime: '2019-01-01', dataset: undefined, description: 'test description', fileSize: 100, id: 123, location: 'test location', - datafileModTime: '2020-01-02', + modTime: '2020-01-02', + datafileModTime: '2019-01-02', name: 'Datafile.txt', parameters: [], } satisfies Datafile; diff --git a/packages/datagateway-dataview/src/views/table/datafileTable.component.test.tsx b/packages/datagateway-dataview/src/views/table/datafileTable.component.test.tsx index e9a71df7c..35dfaee96 100644 --- a/packages/datagateway-dataview/src/views/table/datafileTable.component.test.tsx +++ b/packages/datagateway-dataview/src/views/table/datafileTable.component.test.tsx @@ -63,8 +63,10 @@ describe('Datafile table component', () => { name: 'Test 1', location: '/test1', fileSize: 1, - datafileModTime: '2019-07-23', - datafileCreateTime: '2019-07-23', + modTime: '2019-07-23', + createTime: '2019-07-23', + datafileModTime: '2019-01-02', + datafileCreateTime: '2019-01-01', }, ]; history = createMemoryHistory(); @@ -200,7 +202,7 @@ describe('Datafile table component', () => { findCellInRow(row, { columnIndex: await findColumnIndexByName('datafiles.modified_time'), }) - ).getByText('2019-07-23') + ).getByText('2019-01-02') ).toBeInTheDocument(); }); @@ -243,7 +245,9 @@ describe('Datafile table component', () => { expect(history.length).toBe(2); expect(history.location.search).toBe( - `?filters=${encodeURIComponent('{"datafileModTime":{"endDate":"2019-08-06"}}')}` + `?filters=${encodeURIComponent( + '{"datafileModTime":{"endDate":"2019-08-06"}}' + )}` ); // await user.clear(filterInput); diff --git a/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx b/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx index df6f781da..b4501d05c 100644 --- a/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx +++ b/packages/datagateway-dataview/src/views/table/dls/dlsDatafilesTable.component.test.tsx @@ -78,8 +78,10 @@ describe('DLS datafiles table component', () => { name: 'Test 1', location: '/test1', fileSize: 1, - datafileModTime: '2019-07-23', - datafileCreateTime: '2019-07-23', + modTime: '2019-07-23', + createTime: '2019-07-23', + datafileModTime: '2019-01-02', + datafileCreateTime: '2019-01-01', }, ]; history = createMemoryHistory(); @@ -165,7 +167,7 @@ describe('DLS datafiles table component', () => { findCellInRow(row, { columnIndex: await findColumnIndexByName('datafiles.create_time'), }) - ).getByText('2019-07-23') + ).getByText('2019-01-01') ).toBeInTheDocument(); }); diff --git a/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx b/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx index 144941130..5b89cd726 100644 --- a/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx +++ b/packages/datagateway-dataview/src/views/table/isis/isisDatafilesTable.component.test.tsx @@ -61,8 +61,10 @@ describe('ISIS datafiles table component', () => { name: 'Test 1', location: '/test1', fileSize: 1, - datafileModTime: '2019-07-23', - datafileCreateTime: '2019-07-23', + modTime: '2019-07-23', + createTime: '2019-07-23', + datafileModTime: '2019-01-02', + datafileCreateTime: '2019-01-01', }, ]; cartItems = []; @@ -201,7 +203,7 @@ describe('ISIS datafiles table component', () => { findCellInRow(row, { columnIndex: await findColumnIndexByName('datafiles.modified_time'), }) - ).getByText('2019-07-23') + ).getByText('2019-01-02') ).toBeInTheDocument(); }); diff --git a/packages/datagateway-download/src/testData.ts b/packages/datagateway-download/src/testData.ts index fd4dc6b10..5e229ddb1 100644 --- a/packages/datagateway-download/src/testData.ts +++ b/packages/datagateway-download/src/testData.ts @@ -323,8 +323,8 @@ export const mockDatafiles: Datafile[] = [ { id: 70, name: 'datafile weekend', - datafileModTime: '2018-03-10T08:19:55Z', - datafileCreateTime: '2018-03-10T08:19:55Z', + modTime: '2018-03-10T08:19:55Z', + createTime: '2018-03-10T08:19:55Z', dataset: mockDatasets[0], }, ]; From a424309c3d47e7427ed4166b1ac62aef74b50a70 Mon Sep 17 00:00:00 2001 From: Louise Davies Date: Mon, 2 Sep 2024 10:38:13 +0100 Subject: [PATCH 12/12] Update dgw-api version used in CI - also improve datafilePreview e2e tests --- .github/workflows/ci-build.yml | 6 +++--- .../datagateway-dataview/cypress/e2e/datafilePreview.cy.ts | 6 +++--- .../datagateway-dataview/cypress/fixtures/datafile.json | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index f2ee6a3fe..f40bb1b7d 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -143,7 +143,7 @@ jobs: with: repository: ral-facilities/datagateway-api path: datagateway-api - ref: v9.0.2 + ref: v9.0.3 # DataGateway API file setup - name: Create search_api_mapping.json @@ -301,7 +301,7 @@ jobs: with: repository: ral-facilities/datagateway-api path: datagateway-api - ref: v9.0.2 + ref: v9.0.3 # DataGateway API file setup - name: Create search_api_mapping.json @@ -436,7 +436,7 @@ jobs: with: repository: ral-facilities/datagateway-api path: datagateway-api - ref: v9.0.2 + ref: v9.0.3 # DataGateway API file setup - name: Create search_api_mapping.json diff --git a/packages/datagateway-dataview/cypress/e2e/datafilePreview.cy.ts b/packages/datagateway-dataview/cypress/e2e/datafilePreview.cy.ts index 7a8757e2e..e09985dd2 100644 --- a/packages/datagateway-dataview/cypress/e2e/datafilePreview.cy.ts +++ b/packages/datagateway-dataview/cypress/e2e/datafilePreview.cy.ts @@ -64,7 +64,7 @@ describe('Datafile preview', () => { cy.contains('159.93 MB').should('exist'); cy.contains('/wish/although/eat.txt').should('exist'); cy.contains('2019-09-05 14:03:35+01:00').should('exist'); - cy.contains('2019-09-05 14:03:35+01:00').should('exist'); + cy.contains('2011-03-25 13:11:50+00:00').should('exist'); // should be at 100% zoom cy.contains('100%').should('exist'); @@ -162,7 +162,7 @@ describe('Datafile preview', () => { cy.contains('159.93 MB').should('not.exist'); cy.contains('/wish/although/eat.txt').should('not.exist'); cy.contains('2019-09-05 14:03:35+01:00').should('not.exist'); - cy.contains('2019-09-05 14:03:35+01:00').should('not.exist'); + cy.contains('2011-03-25 13:11:50+00:00').should('not.exist'); // see above for the HTML structure of the checkbox cy.get('label') @@ -181,7 +181,7 @@ describe('Datafile preview', () => { cy.contains('159.93 MB').should('exist'); cy.contains('/wish/although/eat.txt').should('exist'); cy.contains('2019-09-05 14:03:35+01:00').should('exist'); - cy.contains('2019-09-05 14:03:35+01:00').should('exist'); + cy.contains('2011-03-25 13:11:50+00:00').should('exist'); // see above for the HTML structure of the checkbox cy.get('label') diff --git a/packages/datagateway-dataview/cypress/fixtures/datafile.json b/packages/datagateway-dataview/cypress/fixtures/datafile.json index d8dacab6a..cb66a69a7 100644 --- a/packages/datagateway-dataview/cypress/fixtures/datafile.json +++ b/packages/datagateway-dataview/cypress/fixtures/datafile.json @@ -1,12 +1,12 @@ [ { "datafileModTime": "2019-09-05 14:03:35+01:00", - "modTime": "2019-09-05 14:03:35+01:00", + "modTime": "2019-09-06 14:03:35+01:00", "checksum": "ca0b59c00703c61a077e099c3d4f4d5f", "datafileCreateTime": "2011-03-25 13:11:50+00:00", "fileSize": 159934493, "name": "Datafile 3484.txt", - "createTime": "2011-03-25 13:11:50+00:00", + "createTime": "2011-03-26 13:11:50+00:00", "createId": "user", "description": "Effort plan social history carry this summer stuff. Fear source yard small.\nTogether discover new account parent. Learn wall industry red suffer. Black concern building behavior able long.", "location": "/wish/although/eat.txt",