From c42c1b2ef67fad93e21b472be334c42b9fa485f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 27 Oct 2022 12:28:37 +0200 Subject: [PATCH] Fix group slug tests --- .../src/middleware/slugifyMiddleware.spec.js | 54 ------------------- backend/src/schema/resolvers/groups.spec.js | 2 +- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/backend/src/middleware/slugifyMiddleware.spec.js b/backend/src/middleware/slugifyMiddleware.spec.js index 0b022fb53..1fdfb7364 100644 --- a/backend/src/middleware/slugifyMiddleware.spec.js +++ b/backend/src/middleware/slugifyMiddleware.spec.js @@ -213,33 +213,6 @@ describe('slugifyMiddleware', () => { describe('if group exists', () => { describe('if new slug not(!) exists', () => { - describe('setting slug by group name', () => { - it('has the new slug', async () => { - await expect( - mutate({ - mutation: updateGroupMutation(), - variables: { - id: createGroupResult.data.CreateGroup.id, - name: 'My Best Group', - }, - }), - ).resolves.toMatchObject({ - data: { - UpdateGroup: { - name: 'My Best Group', - slug: 'my-best-group', - about: 'Some about', - description: 'Some description' + descriptionAdditional100, - groupType: 'closed', - actionRadius: 'national', - myRole: 'owner', - }, - }, - errors: undefined, - }) - }) - }) - describe('setting slug explicitly', () => { it('has the new slug', async () => { await expect( @@ -284,33 +257,6 @@ describe('slugifyMiddleware', () => { }) }) - describe('setting slug by group name', () => { - it('has unique slug "*-1"', async () => { - await expect( - mutate({ - mutation: updateGroupMutation(), - variables: { - id: createGroupResult.data.CreateGroup.id, - name: 'Pre-Existing Group', - }, - }), - ).resolves.toMatchObject({ - data: { - UpdateGroup: { - name: 'Pre-Existing Group', - slug: 'pre-existing-group-1', - about: 'Some about', - description: 'Some description' + descriptionAdditional100, - groupType: 'closed', - actionRadius: 'national', - myRole: 'owner', - }, - }, - errors: undefined, - }) - }) - }) - describe('setting slug explicitly', () => { it('rejects UpdateGroup', async (done) => { try { diff --git a/backend/src/schema/resolvers/groups.spec.js b/backend/src/schema/resolvers/groups.spec.js index d707440a4..3be8c0f90 100644 --- a/backend/src/schema/resolvers/groups.spec.js +++ b/backend/src/schema/resolvers/groups.spec.js @@ -2714,7 +2714,7 @@ describe('in mode', () => { UpdateGroup: { id: 'my-group', name: 'The New Group For Our Country', - slug: 'the-new-group-for-our-country', // changing the slug is tested in the slugifyMiddleware + slug: 'the-best-group', // changing the slug is tested in the slugifyMiddleware about: 'We will change the land!', description: 'Some country relevant description' + descriptionAdditional100, descriptionExcerpt: