From ee32dedf61e2d2ab6704fd40eec2a9e436f2114f Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 5 Feb 2026 15:38:25 +0000 Subject: Enhance testing and integration for checkbox-list custom field - Updated Gitea workflow to trigger on pushes to the master branch and refined job configurations for testing and E2E processes. - Added Jest and Playwright configurations for integration and E2E testing. - Introduced new checkbox-item API with corresponding controller, service, and routes. - Created integration tests for the checkbox-list functionality, ensuring proper handling of required fields and default values. - Updated package.json and package-lock.json to include necessary dependencies for testing. --- .../content-types/checkbox-item/schema.json | 51 ++++++++++++++++++++++ .../api/checkbox-item/controllers/checkbox-item.ts | 7 +++ .../src/api/checkbox-item/routes/checkbox-item.ts | 7 +++ .../api/checkbox-item/services/checkbox-item.ts | 7 +++ 4 files changed, 72 insertions(+) create mode 100644 playground/src/api/checkbox-item/content-types/checkbox-item/schema.json create mode 100644 playground/src/api/checkbox-item/controllers/checkbox-item.ts create mode 100644 playground/src/api/checkbox-item/routes/checkbox-item.ts create mode 100644 playground/src/api/checkbox-item/services/checkbox-item.ts (limited to 'playground/src/api/checkbox-item') diff --git a/playground/src/api/checkbox-item/content-types/checkbox-item/schema.json b/playground/src/api/checkbox-item/content-types/checkbox-item/schema.json new file mode 100644 index 0000000..863462a --- /dev/null +++ b/playground/src/api/checkbox-item/content-types/checkbox-item/schema.json @@ -0,0 +1,51 @@ +{ + "kind": "collectionType", + "collectionName": "checkbox_items", + "info": { + "singularName": "checkbox-item", + "pluralName": "checkbox-items", + "displayName": "Checkbox Item", + "description": "Content type for checkbox list integration tests" + }, + "options": { + "draftAndPublish": false + }, + "pluginOptions": {}, + "attributes": { + "title": { + "type": "string", + "required": true + }, + "choices": { + "type": "customField", + "customField": "plugin::checkbox-list.checkbox-list", + "options": { + "enum": ["alpha", "beta", "gamma"] + } + }, + "choicesRequired": { + "type": "customField", + "customField": "plugin::checkbox-list.checkbox-list", + "options": { + "enum": ["alpha", "beta"] + }, + "required": true + }, + "choicesPrivate": { + "type": "customField", + "customField": "plugin::checkbox-list.checkbox-list", + "options": { + "enum": ["secret", "top-secret"] + }, + "private": true + }, + "choicesDefault": { + "type": "customField", + "customField": "plugin::checkbox-list.checkbox-list", + "options": { + "enum": ["defaultA", "defaultB"] + }, + "default": ["defaultA"] + } + } +} diff --git a/playground/src/api/checkbox-item/controllers/checkbox-item.ts b/playground/src/api/checkbox-item/controllers/checkbox-item.ts new file mode 100644 index 0000000..c26226f --- /dev/null +++ b/playground/src/api/checkbox-item/controllers/checkbox-item.ts @@ -0,0 +1,7 @@ +/** + * checkbox-item controller + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreController('api::checkbox-item.checkbox-item'); diff --git a/playground/src/api/checkbox-item/routes/checkbox-item.ts b/playground/src/api/checkbox-item/routes/checkbox-item.ts new file mode 100644 index 0000000..bac5602 --- /dev/null +++ b/playground/src/api/checkbox-item/routes/checkbox-item.ts @@ -0,0 +1,7 @@ +/** + * checkbox-item router + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreRouter('api::checkbox-item.checkbox-item'); diff --git a/playground/src/api/checkbox-item/services/checkbox-item.ts b/playground/src/api/checkbox-item/services/checkbox-item.ts new file mode 100644 index 0000000..11c393f --- /dev/null +++ b/playground/src/api/checkbox-item/services/checkbox-item.ts @@ -0,0 +1,7 @@ +/** + * checkbox-item service + */ + +import { factories } from '@strapi/strapi'; + +export default factories.createCoreService('api::checkbox-item.checkbox-item'); -- cgit v1.2.3