Test 'descriptionExcerpt' in all relevant group resolvers

This commit is contained in:
Wolfgang Huß 2022-09-18 19:18:44 +02:00
parent e53e502587
commit bba4ca0fc6
3 changed files with 15 additions and 9 deletions

View File

@ -35,7 +35,7 @@ export const createGroupMutation = () => {
deleted deleted
about about
description description
# descriptionExcerpt # test this as result descriptionExcerpt
groupType groupType
actionRadius actionRadius
categories { categories {
@ -89,7 +89,7 @@ export const updateGroupMutation = () => {
deleted deleted
about about
description description
# descriptionExcerpt # test this as result descriptionExcerpt
groupType groupType
actionRadius actionRadius
categories { categories {
@ -165,7 +165,7 @@ export const groupQuery = () => {
deleted deleted
about about
description description
# descriptionExcerpt # test this as result descriptionExcerpt
groupType groupType
actionRadius actionRadius
categories { categories {

View File

@ -303,6 +303,7 @@ describe('in mode', () => {
slug: 'the-group', slug: 'the-group',
about: 'We will change the world!', about: 'We will change the world!',
description: 'Some description' + descriptionAdditional100, description: 'Some description' + descriptionAdditional100,
descriptionExcerpt: 'Some description' + descriptionAdditional100,
groupType: 'public', groupType: 'public',
actionRadius: 'regional', actionRadius: 'regional',
locationName: 'Hamburg, Germany', locationName: 'Hamburg, Germany',
@ -553,7 +554,7 @@ describe('in mode', () => {
describe('query groups', () => { describe('query groups', () => {
describe('in general finds only listed groups no hidden groups where user is none or pending member', () => { describe('in general finds only listed groups no hidden groups where user is none or pending member', () => {
describe('without any filters', () => { describe('without any filters', () => {
it('finds all listed groups including the set locations', async () => { it('finds all listed groups including the set descriptionExcerpts and locations', async () => {
const result = await query({ query: groupQuery(), variables: {} }) const result = await query({ query: groupQuery(), variables: {} })
expect(result).toMatchObject({ expect(result).toMatchObject({
data: { data: {
@ -561,6 +562,7 @@ describe('in mode', () => {
expect.objectContaining({ expect.objectContaining({
id: 'my-group', id: 'my-group',
slug: 'the-best-group', slug: 'the-best-group',
descriptionExcerpt: 'Some description' + descriptionAdditional100,
locationName: 'Hamburg, Germany', locationName: 'Hamburg, Germany',
location: expect.objectContaining({ location: expect.objectContaining({
name: 'Hamburg', name: 'Hamburg',
@ -572,6 +574,7 @@ describe('in mode', () => {
expect.objectContaining({ expect.objectContaining({
id: 'others-group', id: 'others-group',
slug: 'uninteresting-group', slug: 'uninteresting-group',
descriptionExcerpt: 'We love it like it is!?' + descriptionAdditional100,
locationName: null, locationName: null,
location: null, location: null,
myRole: null, myRole: null,
@ -579,6 +582,7 @@ describe('in mode', () => {
expect.objectContaining({ expect.objectContaining({
id: 'third-hidden-group', id: 'third-hidden-group',
slug: 'third-investigative-journalism-group', slug: 'third-investigative-journalism-group',
descriptionExcerpt: 'We research …' + descriptionAdditional100,
myRole: 'usual', myRole: 'usual',
locationName: null, locationName: null,
location: null, location: null,
@ -2713,6 +2717,8 @@ describe('in mode', () => {
slug: 'the-new-group-for-our-country', // changing the slug is tested in the slugifyMiddleware slug: 'the-new-group-for-our-country', // changing the slug is tested in the slugifyMiddleware
about: 'We will change the land!', about: 'We will change the land!',
description: 'Some country relevant description' + descriptionAdditional100, description: 'Some country relevant description' + descriptionAdditional100,
descriptionExcerpt:
'Some country relevant description' + descriptionAdditional100,
actionRadius: 'national', actionRadius: 'national',
// avatar, // test this as result // avatar, // test this as result
myRole: 'owner', myRole: 'owner',

View File

@ -35,7 +35,7 @@ export const createGroupMutation = () => {
deleted deleted
about about
description description
# descriptionExcerpt # test this as result descriptionExcerpt
groupType groupType
actionRadius actionRadius
categories { categories {
@ -44,7 +44,7 @@ export const createGroupMutation = () => {
name name
icon icon
} }
locationName # test this as result locationName
myRole myRole
} }
} }
@ -84,7 +84,7 @@ export const updateGroupMutation = () => {
deleted deleted
about about
description description
descriptionExcerpt # test this as result descriptionExcerpt
groupType groupType
actionRadius actionRadius
categories { categories {
@ -94,7 +94,7 @@ export const updateGroupMutation = () => {
icon icon
} }
# avatar # test this as result # avatar # test this as result
locationName # test this as result locationName
myRole myRole
} }
} }
@ -156,7 +156,7 @@ export const groupQuery = (i18n) => {
deleted deleted
about about
description description
descriptionExcerpt # test this as result descriptionExcerpt
groupType groupType
actionRadius actionRadius
categories { categories {