From 9c1d6d7f1f869d492598c01c740b549feeb55f93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 4 Jan 2024 11:48:21 +0100 Subject: [PATCH 1/2] Change group 'DESCRIPTION_WITHOUT_HTML_LENGTH_MIN = 3', was '50' --- backend/src/constants/groups.ts | 2 +- webapp/constants/groups.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/constants/groups.ts b/backend/src/constants/groups.ts index b1c305add..6300afa35 100644 --- a/backend/src/constants/groups.ts +++ b/backend/src/constants/groups.ts @@ -1,3 +1,3 @@ // this file is duplicated in `backend/src/constants/group` and `webapp/constants/group.js` -export const DESCRIPTION_WITHOUT_HTML_LENGTH_MIN = 50 // with removed HTML tags +export const DESCRIPTION_WITHOUT_HTML_LENGTH_MIN = 3 // with removed HTML tags export const DESCRIPTION_EXCERPT_HTML_LENGTH = 250 // with removed HTML tags diff --git a/webapp/constants/groups.js b/webapp/constants/groups.js index a634425a4..029f492e0 100644 --- a/webapp/constants/groups.js +++ b/webapp/constants/groups.js @@ -1,5 +1,5 @@ // this file is duplicated in `backend/src/constants/group.js` and `webapp/constants/group.js` export const NAME_LENGTH_MIN = 3 export const NAME_LENGTH_MAX = 50 -export const DESCRIPTION_WITHOUT_HTML_LENGTH_MIN = 50 // with removed HTML tags +export const DESCRIPTION_WITHOUT_HTML_LENGTH_MIN = 3 // with removed HTML tags export const SHOW_GROUP_BUTTON_IN_HEADER = true From 6a87ed5cb4a815562c288ccc2089693bb6c54b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 4 Jan 2024 14:48:13 +0100 Subject: [PATCH 2/2] Fix backend tests to new default group description length without HTML --- backend/src/schema/resolvers/groups.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/schema/resolvers/groups.spec.ts b/backend/src/schema/resolvers/groups.spec.ts index 315388490..f99133be1 100644 --- a/backend/src/schema/resolvers/groups.spec.ts +++ b/backend/src/schema/resolvers/groups.spec.ts @@ -328,15 +328,15 @@ describe('in mode', () => { describe('description', () => { describe('length without HTML', () => { - describe('less then 100 chars', () => { + describe('less then 3 chars', () => { it('throws error: "Description too short!"', async () => { const { errors } = await mutate({ mutation: createGroupMutation(), variables: { ...variables, description: - '0123456789' + - '0123456789', + '0' + + '0', }, }) expect(errors![0]).toHaveProperty('message', 'Description too short!') @@ -2850,15 +2850,15 @@ describe('in mode', () => { describe('description', () => { describe('length without HTML', () => { - describe('less then 100 chars', () => { + describe('less then 3 chars', () => { it('throws error: "Description too short!"', async () => { const { errors } = await mutate({ mutation: updateGroupMutation(), variables: { id: 'my-group', description: - '0123456789' + - '0123456789', + '0' + + '0', }, }) expect(errors![0]).toHaveProperty('message', 'Description too short!')