From 40670130292cc34f4e4ecf100f04f6224838048a Mon Sep 17 00:00:00 2001 From: David Jimenez Barrantes Date: Fri, 28 Jul 2023 11:18:47 -0600 Subject: [PATCH] =?UTF-8?q?[RND-611]=20Adds=20an=20e2e=20test=20to=20show?= =?UTF-8?q?=20that=20we=20can=20insert=20an=20EducationContent=20witho?= =?UTF-8?q?=E2=80=A6=20(#276)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adds an e2e test to show that we can insert an EducationContent without shortDescription, contentClassDescriptor and learningResourceMetadataURI * Removes unnecessary check from the new test. --- .../package.json | 2 +- .../package.json | 2 +- Meadowlark-js/package-lock.json | 34 +++++++++---------- .../packages/meadowlark-core/package.json | 6 ++-- .../e2e/endpoints/educationContents.test.ts | 22 ++++++++++++ 5 files changed, 44 insertions(+), 22 deletions(-) diff --git a/Meadowlark-js/backends/meadowlark-elasticsearch-backend/package.json b/Meadowlark-js/backends/meadowlark-elasticsearch-backend/package.json index e80254c5..95e15d90 100644 --- a/Meadowlark-js/backends/meadowlark-elasticsearch-backend/package.json +++ b/Meadowlark-js/backends/meadowlark-elasticsearch-backend/package.json @@ -21,7 +21,7 @@ "dependencies": { "@edfi/meadowlark-core": "^v0.3.6-pre-36", "@edfi/meadowlark-utilities": "^v0.3.6-pre-36", - "@edfi/metaed-core": "^4.1.2-dev.18", + "@edfi/metaed-core": "^4.1.2-dev.20", "@elastic/elasticsearch": "^8.8.1", "@elastic/transport": "^8.3.2" }, diff --git a/Meadowlark-js/backends/meadowlark-opensearch-backend/package.json b/Meadowlark-js/backends/meadowlark-opensearch-backend/package.json index fc5a10b5..a06a8af7 100644 --- a/Meadowlark-js/backends/meadowlark-opensearch-backend/package.json +++ b/Meadowlark-js/backends/meadowlark-opensearch-backend/package.json @@ -21,7 +21,7 @@ "dependencies": { "@edfi/meadowlark-core": "^v0.3.6-pre-36", "@edfi/meadowlark-utilities": "^v0.3.6-pre-36", - "@edfi/metaed-core": "^4.1.2-dev.18", + "@edfi/metaed-core": "^4.1.2-dev.20", "@opensearch-project/opensearch": "^2.2.1" }, "devDependencies": { diff --git a/Meadowlark-js/package-lock.json b/Meadowlark-js/package-lock.json index 5089f928..7d92faa1 100644 --- a/Meadowlark-js/package-lock.json +++ b/Meadowlark-js/package-lock.json @@ -51,7 +51,7 @@ "dependencies": { "@edfi/meadowlark-core": "^v0.3.6-pre-36", "@edfi/meadowlark-utilities": "^v0.3.6-pre-36", - "@edfi/metaed-core": "^4.1.2-dev.18", + "@edfi/metaed-core": "^4.1.2-dev.20", "@elastic/elasticsearch": "^8.8.1", "@elastic/transport": "^8.3.2" }, @@ -89,7 +89,7 @@ "dependencies": { "@edfi/meadowlark-core": "^v0.3.6-pre-36", "@edfi/meadowlark-utilities": "^v0.3.6-pre-36", - "@edfi/metaed-core": "^4.1.2-dev.18", + "@edfi/metaed-core": "^4.1.2-dev.20", "@opensearch-project/opensearch": "^2.2.1" }, "devDependencies": { @@ -1441,9 +1441,9 @@ "link": true }, "node_modules/@edfi/metaed-core": { - "version": "4.1.2-dev.18", - "resolved": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/npm/registry/@edfi/metaed-core/-/metaed-core-4.1.2-dev.18.tgz", - "integrity": "sha1-T4Bmu96Eh2ITLv71n7H/I0U9Z6o=", + "version": "4.1.2-dev.20", + "resolved": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/npm/registry/@edfi/metaed-core/-/metaed-core-4.1.2-dev.20.tgz", + "integrity": "sha1-uErDRwTZY+VU1c2Pr8k9SrrZFpE=", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "@edfi/antlr4": "4.6.1", @@ -1498,25 +1498,25 @@ } }, "node_modules/@edfi/metaed-plugin-edfi-api-schema": { - "version": "4.1.2-dev.18", - "resolved": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/npm/registry/@edfi/metaed-plugin-edfi-api-schema/-/metaed-plugin-edfi-api-schema-4.1.2-dev.18.tgz", - "integrity": "sha1-JE77+uRA1my9O5DqSVx7bdoCxzA=", + "version": "4.1.2-dev.20", + "resolved": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/npm/registry/@edfi/metaed-plugin-edfi-api-schema/-/metaed-plugin-edfi-api-schema-4.1.2-dev.20.tgz", + "integrity": "sha1-hn1AASlihXMEuG6dKibVYIgD444=", "license": "Apache-2.0", "dependencies": { - "@edfi/metaed-core": "4.1.2-dev.18", - "@edfi/metaed-plugin-edfi-unified": "4.1.2-dev.18", + "@edfi/metaed-core": "4.1.2-dev.20", + "@edfi/metaed-plugin-edfi-unified": "4.1.2-dev.20", "deep-freeze": "^0.0.1", "inflection": "^1.13.4", "ts-invariant": "^0.10.3" } }, "node_modules/@edfi/metaed-plugin-edfi-unified": { - "version": "4.1.2-dev.18", - "resolved": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/npm/registry/@edfi/metaed-plugin-edfi-unified/-/metaed-plugin-edfi-unified-4.1.2-dev.18.tgz", - "integrity": "sha1-5clwx7bN+/S1LIno13xNBO5F+f4=", + "version": "4.1.2-dev.20", + "resolved": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/npm/registry/@edfi/metaed-plugin-edfi-unified/-/metaed-plugin-edfi-unified-4.1.2-dev.20.tgz", + "integrity": "sha1-5vD7oZ5niELaGlgD1J2NIQ0P/CM=", "license": "SEE LICENSE IN LICENSE.md", "dependencies": { - "@edfi/metaed-core": "4.1.2-dev.18", + "@edfi/metaed-core": "4.1.2-dev.20", "ramda": "^0.28.0" } }, @@ -17164,9 +17164,9 @@ "@edfi/ed-fi-model-3.1": "3.0.1", "@edfi/ed-fi-model-3.3b": "3.0.1", "@edfi/meadowlark-utilities": "^v0.3.6-pre-36", - "@edfi/metaed-core": "^4.1.2-dev.18", - "@edfi/metaed-plugin-edfi-api-schema": "^4.1.2-dev.18", - "@edfi/metaed-plugin-edfi-unified": "^4.1.2-dev.18", + "@edfi/metaed-core": "^4.1.2-dev.20", + "@edfi/metaed-plugin-edfi-api-schema": "^4.1.2-dev.20", + "@edfi/metaed-plugin-edfi-unified": "^4.1.2-dev.20", "@isaacs/ttlcache": "^1.4.1", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", diff --git a/Meadowlark-js/packages/meadowlark-core/package.json b/Meadowlark-js/packages/meadowlark-core/package.json index b9952fb6..55c7d1c3 100644 --- a/Meadowlark-js/packages/meadowlark-core/package.json +++ b/Meadowlark-js/packages/meadowlark-core/package.json @@ -17,9 +17,9 @@ "@edfi/ed-fi-model-3.1": "3.0.1", "@edfi/ed-fi-model-3.3b": "3.0.1", "@edfi/meadowlark-utilities": "^v0.3.6-pre-36", - "@edfi/metaed-core": "^4.1.2-dev.18", - "@edfi/metaed-plugin-edfi-api-schema": "^4.1.2-dev.18", - "@edfi/metaed-plugin-edfi-unified": "^4.1.2-dev.18", + "@edfi/metaed-core": "^4.1.2-dev.20", + "@edfi/metaed-plugin-edfi-api-schema": "^4.1.2-dev.20", + "@edfi/metaed-plugin-edfi-unified": "^4.1.2-dev.20", "@isaacs/ttlcache": "^1.4.1", "ajv": "^8.12.0", "ajv-formats": "^2.1.1", diff --git a/Meadowlark-js/tests/e2e/endpoints/educationContents.test.ts b/Meadowlark-js/tests/e2e/endpoints/educationContents.test.ts index 2d308b5d..ec81e118 100644 --- a/Meadowlark-js/tests/e2e/endpoints/educationContents.test.ts +++ b/Meadowlark-js/tests/e2e/endpoints/educationContents.test.ts @@ -18,6 +18,28 @@ describe('Education contents', () => { contentClassDescriptor = await getDescriptorByLocation(contentClassDescriptorLocation); }); + // The Data Standard defines EducationContent.LearningResource as a required "Choice". + // The MetaEd documentation notes that this "requirement" will not be enforced by the API, and in fact the ODS/API does not enforce it. + describe('when creating an EducationContent without shortDescription, contentClassDescriptor and learningResourceMetadataURI', () => { + beforeAll(async () => { + const contentIdentifier = generateRandomId(); + educationContentLocation = await createResource({ + endpoint: 'educationContents', + body: { + contentIdentifier, + namespace: '43211', + }, + }); + }); + + it('should create the education content', async () => { + await rootURLRequest() + .get(educationContentLocation) + .auth(await getAccessToken('vendor'), { type: 'bearer' }) + .expect(200); + }); + }); + describe('Create', () => { it('should create an education content', async () => { const contentIdentifier = generateRandomId();