Test locations in group resolvers

This commit is contained in:
Wolfgang Huß 2022-09-16 21:09:45 +02:00
parent a52c3b488e
commit 57f7a43d09
3 changed files with 41 additions and 6 deletions

View File

@ -42,7 +42,12 @@ export const createGroupMutation = gql`
name name
icon icon
} }
# locationName # test this as result locationName
location {
name
nameDE
nameEN
}
myRole myRole
} }
} }
@ -89,7 +94,12 @@ export const updateGroupMutation = gql`
icon icon
} }
# avatar # test this as result # avatar # test this as result
# locationName # test this as result locationName
location {
name
nameDE
nameEN
}
myRole myRole
} }
} }
@ -154,7 +164,12 @@ export const groupQuery = gql`
avatar { avatar {
url url
} }
# locationName # test this as result locationName
location {
name
nameDE
nameEN
}
myRole myRole
} }
} }

View File

@ -277,7 +277,7 @@ describe('in mode', () => {
groupType: 'public', groupType: 'public',
actionRadius: 'regional', actionRadius: 'regional',
categoryIds, categoryIds,
// locationName, // test this as result locationName: 'Hamburg, Germany',
} }
}) })
@ -304,6 +304,12 @@ describe('in mode', () => {
description: 'Some description' + descriptionAdditional100, description: 'Some description' + descriptionAdditional100,
groupType: 'public', groupType: 'public',
actionRadius: 'regional', actionRadius: 'regional',
locationName: 'Hamburg, Germany',
location: expect.objectContaining({
name: 'Hamburg',
nameDE: 'Hamburg',
nameEN: 'Hamburg',
}),
}, },
}, },
errors: undefined, errors: undefined,
@ -539,6 +545,7 @@ describe('in mode', () => {
groupType: 'public', groupType: 'public',
actionRadius: 'regional', actionRadius: 'regional',
categoryIds, categoryIds,
locationName: 'Hamburg, Germany',
}, },
}) })
}) })
@ -554,6 +561,12 @@ describe('in mode', () => {
expect.objectContaining({ expect.objectContaining({
id: 'my-group', id: 'my-group',
slug: 'the-best-group', slug: 'the-best-group',
locationName: 'Hamburg, Germany',
location: expect.objectContaining({
name: 'Hamburg',
nameDE: 'Hamburg',
nameEN: 'Hamburg',
}),
myRole: 'owner', myRole: 'owner',
}), }),
expect.objectContaining({ expect.objectContaining({
@ -2642,6 +2655,7 @@ describe('in mode', () => {
groupType: 'public', groupType: 'public',
actionRadius: 'regional', actionRadius: 'regional',
categoryIds, categoryIds,
locationName: 'Hamburg, Germany',
}, },
}) })
}) })
@ -2663,7 +2677,7 @@ describe('in mode', () => {
description: 'Some country relevant description' + descriptionAdditional100, description: 'Some country relevant description' + descriptionAdditional100,
actionRadius: 'national', actionRadius: 'national',
// avatar, // test this as result // avatar, // test this as result
// locationName, // test this as result locationName: 'Berlin, Germany',
}, },
}), }),
).resolves.toMatchObject({ ).resolves.toMatchObject({
@ -2676,7 +2690,12 @@ describe('in mode', () => {
description: 'Some country relevant description' + descriptionAdditional100, description: 'Some country relevant description' + descriptionAdditional100,
actionRadius: 'national', actionRadius: 'national',
// avatar, // test this as result // avatar, // test this as result
// locationName, // test this as result locationName: 'Berlin, Germany',
location: expect.objectContaining({
name: 'Berlin',
nameDE: 'Berlin',
nameEN: 'Berlin',
}),
myRole: 'owner', myRole: 'owner',
}, },
}, },

View File

@ -12,6 +12,7 @@ export const userFragment = gql`
deleted deleted
} }
` `
export const locationAndBadgesFragment = (lang) => gql` export const locationAndBadgesFragment = (lang) => gql`
fragment locationAndBadges on User { fragment locationAndBadges on User {
location { location {