{isFirst ? null :
}
- {`Test ${test.rowNumber}: ${test.title}`}
-
- -
- Mode:
- {atMode}
-
- -
- Assistive technologies:
- {test.ats.map(at => at.name).join(', ')}
-
- -
- Relevant specifications:
- {specifications.map(([title, link], index) => {
- const isLast =
- index === specifications.length - 1;
- return (
-
-
- {title}
-
- {isLast ? '' : ', '}
-
- );
- })}
-
-
+ {`Test ${index + 1}: ${test.title}`}
+ {/* A defined 'aria' type is only available in v2 */}
+ {isV2 && hasAriaReference ? (
+ <>
+
+ {
+ supportJson.testPlanStrings
+ .ariaSpecsPreface
+ }
+
+
+ {test.renderableContents[0].renderableContent.info.references.map(
+ reference => {
+ let refValue = '';
+ let refLinkText = '';
+ if (reference.type === 'aria') {
+ refValue = reference.value;
+ refLinkText =
+ reference.linkText;
+ }
+ return refValue ? (
+ -
+
+ {refLinkText}
+
+
+ ) : null;
+ }
+ )}
+
+ >
+ ) : null}
{filteredAts.map(at => {
const renderableContent =
test.renderableContents.find(
@@ -241,6 +309,7 @@ const TestReview = () => {
return (
{at.name}
+ Instructions
{
}
at={at}
headingLevel={5}
+ testFormatVersion={
+ testPlanVersion.metadata
+ .testFormatVersion
+ }
/>
);
diff --git a/client/components/TestReview/queries.js b/client/components/TestReview/queries.js
index 442f01772..b6f3aea83 100644
--- a/client/components/TestReview/queries.js
+++ b/client/components/TestReview/queries.js
@@ -1,7 +1,7 @@
import { gql } from '@apollo/client';
export const TEST_REVIEW_PAGE_QUERY = gql`
- query TestPlanVersionsPageQuery($testPlanVersionId: ID!) {
+ query TestReviewPageQuery($testPlanVersionId: ID!) {
testPlanVersion(id: $testPlanVersionId) {
id
title
@@ -40,6 +40,7 @@ export const TEST_REVIEW_PAGE_QUERY = gql`
renderableContent
}
}
+ metadata
}
}
`;
diff --git a/server/resolvers/Test/renderableContentsResolver.js b/server/resolvers/Test/renderableContentsResolver.js
index dfcc6606b..9163fa9ee 100644
--- a/server/resolvers/Test/renderableContentsResolver.js
+++ b/server/resolvers/Test/renderableContentsResolver.js
@@ -1,8 +1,24 @@
+const populateData = require('../../services/PopulatedData/populateData');
const AtLoader = require('../../models/loaders/AtLoader');
-const renderableContents = async test => {
+const renderableContents = async (test, _, context) => {
const ats = await AtLoader().getAll();
+ const { testPlanVersion } = await populateData(
+ { testId: test.id },
+ { context }
+ );
+
+ const isV2 = testPlanVersion.metadata.testFormatVersion === 2;
+ if (isV2) {
+ return test.atIds.map(atId => {
+ return {
+ at: ats.find(at => at.id === atId),
+ renderableContent: test.renderableContent // { renderableContent: { info, ... } }
+ };
+ });
+ }
+ // v1: { renderableContent: { 1: { info, ... }, 2: { ... }, ... } }
return Object.entries(test.renderableContent).map(
([atId, renderableContent]) => {
const at = ats.find(at => at.id == atId);
diff --git a/server/resolvers/Test/renderedUrlsResolver.js b/server/resolvers/Test/renderedUrlsResolver.js
index f13f4cf8e..f65a53f29 100644
--- a/server/resolvers/Test/renderedUrlsResolver.js
+++ b/server/resolvers/Test/renderedUrlsResolver.js
@@ -1,8 +1,25 @@
+const populateData = require('../../services/PopulatedData/populateData');
const AtLoader = require('../../models/loaders/AtLoader');
-const renderedUrls = async test => {
+const renderedUrls = async (test, _, context) => {
const ats = await AtLoader().getAll();
+ const { testPlanVersion } = await populateData(
+ { testId: test.id },
+ { context }
+ );
+
+ const isV2 = testPlanVersion.metadata.testFormatVersion === 2;
+ if (isV2) {
+ return test.atIds.map(atId => {
+ return {
+ at: ats.find(at => at.id === atId),
+ renderedUrl: test.renderedUrl // { renderedUrl: '/url/file/path.html' }
+ };
+ });
+ }
+
+ // v1: { renderedUrls: { 1: '/url/file/path.html' } }
return Object.entries(test.renderedUrls).map(([atId, renderedUrl]) => {
const at = ats.find(at => at.id == atId);
return { at, renderedUrl };