From 78b13b663740c65f9f68b052c53a0f0fcc6e68a3 Mon Sep 17 00:00:00 2001 From: Paul Clue <67766160+Paul-Clue@users.noreply.github.com> Date: Tue, 3 Oct 2023 15:08:00 -0500 Subject: [PATCH 1/2] Fix invalid At Browser combinations --- client/components/DataManagement/queries.js | 12 ++++++++++++ client/components/ManageTestQueue/index.jsx | 18 ++++++++++-------- client/components/TestQueue/queries.js | 12 ++++++++++++ 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/client/components/DataManagement/queries.js b/client/components/DataManagement/queries.js index b7f4233d7..de2cee1ab 100644 --- a/client/components/DataManagement/queries.js +++ b/client/components/DataManagement/queries.js @@ -15,6 +15,18 @@ export const DATA_MANAGEMENT_PAGE_QUERY = gql` name releasedAt } + browsers { + id + name + } + candidateBrowsers { + id + name + } + recommendedBrowsers { + id + name + } } browsers { id diff --git a/client/components/ManageTestQueue/index.jsx b/client/components/ManageTestQueue/index.jsx index 1d884bf30..513480016 100644 --- a/client/components/ManageTestQueue/index.jsx +++ b/client/components/ManageTestQueue/index.jsx @@ -649,14 +649,16 @@ const ManageTestQueue = ({ - {browsers.map(item => ( - - ))} + {ats + .find(at => at.id === selectedAtId) + ?.browsers.map(item => ( + + ))} diff --git a/client/components/TestQueue/queries.js b/client/components/TestQueue/queries.js index 065c5e929..6aa9cbf75 100644 --- a/client/components/TestQueue/queries.js +++ b/client/components/TestQueue/queries.js @@ -20,6 +20,18 @@ export const TEST_QUEUE_PAGE_QUERY = gql` name releasedAt } + browsers { + id + name + } + candidateBrowsers { + id + name + } + recommendedBrowsers { + id + name + } } browsers { id From 1a2773403d23470d10739e0040de7a618d8ba8e7 Mon Sep 17 00:00:00 2001 From: Paul Clue <67766160+Paul-Clue@users.noreply.github.com> Date: Wed, 4 Oct 2023 00:11:54 -0500 Subject: [PATCH 2/2] Fix tests --- .../DataManagementPagePopulatedMock.js | 90 ++++++++++++++++ .../TestQueuePageAdminPopulatedMock.js | 102 ++++++++++++++++-- .../TestQueuePageTesterPopulatedMock.js | 102 ++++++++++++++++-- .../tests/models/services/AtService.test.js | 14 ++- 4 files changed, 293 insertions(+), 15 deletions(-) diff --git a/client/tests/__mocks__/GraphQLMocks/DataManagementPagePopulatedMock.js b/client/tests/__mocks__/GraphQLMocks/DataManagementPagePopulatedMock.js index 1715e7526..e5dd1cbbc 100644 --- a/client/tests/__mocks__/GraphQLMocks/DataManagementPagePopulatedMock.js +++ b/client/tests/__mocks__/GraphQLMocks/DataManagementPagePopulatedMock.js @@ -38,6 +38,36 @@ export default ( name: '2021.2111.13', releasedAt: '2021-11-01T04:00:00.000Z' } + ], + browsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } + ], + candidateBrowsers: [ + { + id: '2', + name: 'Chrome' + } + ], + recommendedBrowsers: [ + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } ] }, { @@ -49,6 +79,36 @@ export default ( name: '2020.4', releasedAt: '2021-02-19T05:00:00.000Z' } + ], + browsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } + ], + candidateBrowsers: [ + { + id: '2', + name: 'Chrome' + } + ], + recommendedBrowsers: [ + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } ] }, { @@ -60,6 +120,36 @@ export default ( name: '11.6 (20G165)', releasedAt: '2019-09-01T04:00:00.000Z' } + ], + browsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } + ], + candidateBrowsers: [ + { + id: '3', + name: 'Safari' + } + ], + recommendedBrowsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '2', + name: 'Chrome' + } ] } ], diff --git a/client/tests/__mocks__/GraphQLMocks/TestQueuePageAdminPopulatedMock.js b/client/tests/__mocks__/GraphQLMocks/TestQueuePageAdminPopulatedMock.js index 2cfcee9b1..432ba50b0 100644 --- a/client/tests/__mocks__/GraphQLMocks/TestQueuePageAdminPopulatedMock.js +++ b/client/tests/__mocks__/GraphQLMocks/TestQueuePageAdminPopulatedMock.js @@ -16,9 +16,39 @@ export default testQueuePageQuery => [ name: 'JAWS', atVersions: [ { - id: '6', - name: '2021.2103.174', - releasedAt: '2022-08-02T14:36:02.659Z' + id: '1', + name: '2021.2111.13', + releasedAt: '2021-11-01T04:00:00.000Z' + } + ], + browsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } + ], + candidateBrowsers: [ + { + id: '2', + name: 'Chrome' + } + ], + recommendedBrowsers: [ + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' } ] }, @@ -51,6 +81,36 @@ export default testQueuePageQuery => [ name: '2019.3', releasedAt: '2022-01-01T12:00:00.000Z' } + ], + browsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } + ], + candidateBrowsers: [ + { + id: '2', + name: 'Chrome' + } + ], + recommendedBrowsers: [ + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } ] }, { @@ -58,9 +118,39 @@ export default testQueuePageQuery => [ name: 'VoiceOver for macOS', atVersions: [ { - id: '7', - name: '11.5.2', - releasedAt: '2022-01-01T12:00:00.000Z' + id: '3', + name: '11.6 (20G165)', + releasedAt: '2019-09-01T04:00:00.000Z' + } + ], + browsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } + ], + candidateBrowsers: [ + { + id: '3', + name: 'Safari' + } + ], + recommendedBrowsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '2', + name: 'Chrome' } ] } diff --git a/client/tests/__mocks__/GraphQLMocks/TestQueuePageTesterPopulatedMock.js b/client/tests/__mocks__/GraphQLMocks/TestQueuePageTesterPopulatedMock.js index 95949a0bc..413bf828f 100644 --- a/client/tests/__mocks__/GraphQLMocks/TestQueuePageTesterPopulatedMock.js +++ b/client/tests/__mocks__/GraphQLMocks/TestQueuePageTesterPopulatedMock.js @@ -17,9 +17,39 @@ export default testQueuePageQuery => [ name: 'JAWS', atVersions: [ { - id: '6', - name: '2021.2103.174', - releasedAt: '2022-08-02T14:36:02.659Z' + id: '1', + name: '2021.2111.13', + releasedAt: '2021-11-01T04:00:00.000Z' + } + ], + browsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } + ], + candidateBrowsers: [ + { + id: '2', + name: 'Chrome' + } + ], + recommendedBrowsers: [ + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' } ] }, @@ -52,6 +82,36 @@ export default testQueuePageQuery => [ name: '2019.3', releasedAt: '2022-01-01T12:00:00.000Z' } + ], + browsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } + ], + candidateBrowsers: [ + { + id: '2', + name: 'Chrome' + } + ], + recommendedBrowsers: [ + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } ] }, { @@ -59,9 +119,39 @@ export default testQueuePageQuery => [ name: 'VoiceOver for macOS', atVersions: [ { - id: '7', - name: '11.5.2', - releasedAt: '2022-01-01T12:00:00.000Z' + id: '3', + name: '11.6 (20G165)', + releasedAt: '2019-09-01T04:00:00.000Z' + } + ], + browsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '1', + name: 'Firefox' + }, + { + id: '2', + name: 'Chrome' + } + ], + candidateBrowsers: [ + { + id: '3', + name: 'Safari' + } + ], + recommendedBrowsers: [ + { + id: '3', + name: 'Safari' + }, + { + id: '2', + name: 'Chrome' } ] } diff --git a/server/tests/models/services/AtService.test.js b/server/tests/models/services/AtService.test.js index 2bae5eba0..5abdba1d0 100644 --- a/server/tests/models/services/AtService.test.js +++ b/server/tests/models/services/AtService.test.js @@ -212,9 +212,17 @@ describe('AtModel Data Checks', () => { it('should return collection of ats with paginated structure', async () => { await dbCleaner(async () => { // A1 - const result = await AtService.getAts('', {}, ['name'], [], [], [], { - enablePagination: true - }); + const result = await AtService.getAts( + '', + {}, + ['name'], + [], + [], + [], + { + enablePagination: true + } + ); // A3 expect(result.data.length).toBeGreaterThanOrEqual(1);