From 40f3327c9ee73c9908c70029a036a0c8c7fecfb8 Mon Sep 17 00:00:00 2001 From: Joshua Melville Date: Thu, 2 Nov 2023 12:09:33 +0200 Subject: [PATCH] relax requirement for sociogram background --- src/__tests__/test-protocols.test.ts | 9 +++++---- src/schemas/1.json | 4 ---- src/schemas/2.json | 4 ---- src/schemas/3.json | 4 ---- src/schemas/4.json | 4 ---- src/schemas/5.json | 4 ---- src/schemas/6.json | 4 ---- src/schemas/7.json | 4 ---- src/schemas/8.json | 4 ---- 9 files changed, 5 insertions(+), 36 deletions(-) diff --git a/src/__tests__/test-protocols.test.ts b/src/__tests__/test-protocols.test.ts index f9b4e62..a1003ec 100644 --- a/src/__tests__/test-protocols.test.ts +++ b/src/__tests__/test-protocols.test.ts @@ -28,11 +28,10 @@ const extractAndValidate = async (protocolPath: string) => { const protocol = await getProtocolJsonAsObject(zip); // Hack because somme test protocols don't specify schema versions correctly - let schemaVersion; + let schemaVersion = undefined; if (!protocol.schemaVersion || protocol.schemaVersion === "1.0.0") { + console.log('schemaVersion is missing or "1.0.0" for', protocolPath); schemaVersion = 1; - } else { - schemaVersion = protocol.schemaVersion; } // Validating protocol... @@ -60,7 +59,9 @@ const extractAndValidate = async (protocolPath: string) => { }; const PROTOCOL_PATH = "../../test-protocols"; -const protocols = readdirSync(join(__dirname, PROTOCOL_PATH)); +const protocols = readdirSync(join(__dirname, PROTOCOL_PATH)).filter((file) => + file.endsWith(".netcanvas"), +); describe("Test protocols", () => { it.each(protocols)("%s", async (protocol) => { diff --git a/src/schemas/1.json b/src/schemas/1.json index 52b4599..1a02a50 100644 --- a/src/schemas/1.json +++ b/src/schemas/1.json @@ -505,10 +505,6 @@ "type": "boolean" } }, - "oneOf": [ - { "required": ["concentricCircles"] }, - { "required": ["image"] } - ], "title": "Background" }, "SortOrder": { diff --git a/src/schemas/2.json b/src/schemas/2.json index 0775eaa..f86325c 100644 --- a/src/schemas/2.json +++ b/src/schemas/2.json @@ -512,10 +512,6 @@ "type": "boolean" } }, - "oneOf": [ - { "required": ["concentricCircles"] }, - { "required": ["image"] } - ], "title": "Background" }, "SortOrder": { diff --git a/src/schemas/3.json b/src/schemas/3.json index 9ef053f..6c1ab31 100644 --- a/src/schemas/3.json +++ b/src/schemas/3.json @@ -524,10 +524,6 @@ "type": "boolean" } }, - "oneOf": [ - { "required": ["concentricCircles"] }, - { "required": ["image"] } - ], "title": "Background" }, "SortOrder": { diff --git a/src/schemas/4.json b/src/schemas/4.json index b6038f8..9a6bb36 100644 --- a/src/schemas/4.json +++ b/src/schemas/4.json @@ -536,10 +536,6 @@ "type": "boolean" } }, - "oneOf": [ - { "required": ["concentricCircles"] }, - { "required": ["image"] } - ], "title": "Background" }, "SortOrder": { diff --git a/src/schemas/5.json b/src/schemas/5.json index 1e97e86..9f10789 100644 --- a/src/schemas/5.json +++ b/src/schemas/5.json @@ -554,10 +554,6 @@ "type": "boolean" } }, - "oneOf": [ - { "required": ["concentricCircles"] }, - { "required": ["image"] } - ], "title": "Background" }, "SortOrder": { diff --git a/src/schemas/6.json b/src/schemas/6.json index 254b5de..ba5d5e1 100644 --- a/src/schemas/6.json +++ b/src/schemas/6.json @@ -556,10 +556,6 @@ "type": "boolean" } }, - "oneOf": [ - { "required": ["concentricCircles"] }, - { "required": ["image"] } - ], "title": "Background" }, "AutomaticLayout": { diff --git a/src/schemas/7.json b/src/schemas/7.json index ae4ba28..c312916 100644 --- a/src/schemas/7.json +++ b/src/schemas/7.json @@ -570,10 +570,6 @@ "type": "boolean" } }, - "oneOf": [ - { "required": ["concentricCircles"] }, - { "required": ["image"] } - ], "title": "Background" }, "AutomaticLayout": { diff --git a/src/schemas/8.json b/src/schemas/8.json index bae2249..f35f908 100644 --- a/src/schemas/8.json +++ b/src/schemas/8.json @@ -574,10 +574,6 @@ "type": "boolean" } }, - "oneOf": [ - { "required": ["concentricCircles"] }, - { "required": ["image"] } - ], "title": "Background" }, "AutomaticLayout": {