diff --git a/backend/src/graphql/arg/TransactionSendArgs.ts b/backend/src/graphql/arg/TransactionSendArgs.ts index 5bd8b89f7..48827be8d 100644 --- a/backend/src/graphql/arg/TransactionSendArgs.ts +++ b/backend/src/graphql/arg/TransactionSendArgs.ts @@ -7,9 +7,9 @@ import { IsPositiveDecimal } from '@/graphql/validator/Decimal' @ArgsType() export class TransactionSendArgs { - @Field(() => String) + @Field(() => String, { nullable: true }) @IsString() - recipientCommunityIdentifier: string + recipientCommunityIdentifier?: string | null | undefined @Field(() => String) @IsString() diff --git a/backend/src/graphql/resolver/CommunityResolver.test.ts b/backend/src/graphql/resolver/CommunityResolver.test.ts index 4b4101e66..0ded14405 100644 --- a/backend/src/graphql/resolver/CommunityResolver.test.ts +++ b/backend/src/graphql/resolver/CommunityResolver.test.ts @@ -12,7 +12,7 @@ import { ApolloServerTestClient } from 'apollo-server-testing' import { cleanDB, testEnvironment } from '@test/helpers' -import { getCommunities, getCommunitySelections } from '@/seeds/graphql/queries' +import { getCommunities, communities } from '@/seeds/graphql/queries' // to do: We need a setup for the tests that closes the connection let query: ApolloServerTestClient['query'], con: Connection @@ -234,7 +234,7 @@ describe('CommunityResolver', () => { }) }) - describe('getCommunitySelections', () => { + describe('communities', () => { let homeCom1: DbCommunity let foreignCom1: DbCommunity let foreignCom2: DbCommunity @@ -248,9 +248,9 @@ describe('CommunityResolver', () => { it('returns no community entry', async () => { // const result: Community[] = await query({ query: getCommunities }) // expect(result.length).toEqual(0) - await expect(query({ query: getCommunitySelections })).resolves.toMatchObject({ + await expect(query({ query: communities })).resolves.toMatchObject({ data: { - getCommunitySelections: [], + communities: [], }, }) }) @@ -275,9 +275,9 @@ describe('CommunityResolver', () => { }) it('returns 1 home-community entry', async () => { - await expect(query({ query: getCommunitySelections })).resolves.toMatchObject({ + await expect(query({ query: communities })).resolves.toMatchObject({ data: { - getCommunitySelections: [ + communities: [ { id: expect.any(Number), foreign: homeCom1.foreign, @@ -337,9 +337,9 @@ describe('CommunityResolver', () => { }) it('returns 3 community entries', async () => { - await expect(query({ query: getCommunitySelections })).resolves.toMatchObject({ + await expect(query({ query: communities })).resolves.toMatchObject({ data: { - getCommunitySelections: [ + communities: [ { id: expect.any(Number), foreign: homeCom1.foreign, diff --git a/backend/src/graphql/resolver/TransactionResolver.test.ts b/backend/src/graphql/resolver/TransactionResolver.test.ts index 5650015c3..bd7d0f2a8 100644 --- a/backend/src/graphql/resolver/TransactionResolver.test.ts +++ b/backend/src/graphql/resolver/TransactionResolver.test.ts @@ -91,7 +91,7 @@ describe('send coins', () => { await mutate({ mutation: sendCoins, variables: { - identifier: 'wrong@email.com', + recipientIdentifier: 'wrong@email.com', amount: 100, memo: 'test test', }, @@ -119,7 +119,7 @@ describe('send coins', () => { await mutate({ mutation: sendCoins, variables: { - identifier: 'stephen@hawking.uk', + recipientIdentifier: 'stephen@hawking.uk', amount: 100, memo: 'test test', }, @@ -148,7 +148,7 @@ describe('send coins', () => { await mutate({ mutation: sendCoins, variables: { - identifier: 'garrick@ollivander.com', + recipientIdentifier: 'garrick@ollivander.com', amount: 100, memo: 'test test', }, @@ -184,7 +184,7 @@ describe('send coins', () => { await mutate({ mutation: sendCoins, variables: { - identifier: 'bob@baumeister.de', + recipientIdentifier: 'bob@baumeister.de', amount: 100, memo: 'test test', }, @@ -207,7 +207,7 @@ describe('send coins', () => { const { errors: errorObjects } = await mutate({ mutation: sendCoins, variables: { - identifier: 'peter@lustig.de', + recipientIdentifier: 'peter@lustig.de', amount: 100, memo: 'Test', }, @@ -238,7 +238,7 @@ describe('send coins', () => { const { errors: errorObjects } = await mutate({ mutation: sendCoins, variables: { - identifier: 'peter@lustig.de', + recipientIdentifier: 'peter@lustig.de', amount: 100, memo: 'test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test t', }, @@ -270,7 +270,7 @@ describe('send coins', () => { await mutate({ mutation: sendCoins, variables: { - identifier: 'peter@lustig.de', + recipientIdentifier: 'peter@lustig.de', amount: 100, memo: 'testing', }, @@ -319,7 +319,7 @@ describe('send coins', () => { const { errors: errorObjects } = await mutate({ mutation: sendCoins, variables: { - identifier: 'peter@lustig.de', + recipientIdentifier: 'peter@lustig.de', amount: -50, memo: 'testing negative', }, @@ -350,7 +350,7 @@ describe('send coins', () => { await mutate({ mutation: sendCoins, variables: { - identifier: 'peter@lustig.de', + recipientIdentifier: 'peter@lustig.de', amount: 50, memo: 'unrepeatable memo', }, @@ -456,7 +456,7 @@ describe('send coins', () => { mutate({ mutation: sendCoins, variables: { - identifier: peter?.gradidoID, + recipientIdentifier: peter?.gradidoID, amount: 10, memo: 'send via gradido ID', }, @@ -496,7 +496,7 @@ describe('send coins', () => { mutate({ mutation: sendCoins, variables: { - identifier: 'bob', + recipientIdentifier: 'bob', amount: 6.66, memo: 'send via alias', }, @@ -564,7 +564,7 @@ describe('send coins', () => { mutate({ mutation: sendCoins, variables: { - identifier: 'peter@lustig.de', + recipientIdentifier: 'peter@lustig.de', amount: 10, memo: 'first transaction', }, @@ -580,7 +580,7 @@ describe('send coins', () => { mutate({ mutation: sendCoins, variables: { - identifier: 'peter@lustig.de', + recipientIdentifier: 'peter@lustig.de', amount: 20, memo: 'second transaction', }, @@ -596,7 +596,7 @@ describe('send coins', () => { mutate({ mutation: sendCoins, variables: { - identifier: 'peter@lustig.de', + recipientIdentifier: 'peter@lustig.de', amount: 30, memo: 'third transaction', }, @@ -612,7 +612,7 @@ describe('send coins', () => { mutate({ mutation: sendCoins, variables: { - identifier: 'peter@lustig.de', + recipientIdentifier: 'peter@lustig.de', amount: 40, memo: 'fourth transaction', }, diff --git a/backend/src/graphql/resolver/semaphore.test.ts b/backend/src/graphql/resolver/semaphore.test.ts index 366b94d72..37331d832 100644 --- a/backend/src/graphql/resolver/semaphore.test.ts +++ b/backend/src/graphql/resolver/semaphore.test.ts @@ -156,7 +156,11 @@ describe('semaphore', () => { }) const bibisTransaction = mutate({ mutation: sendCoins, - variables: { identifier: 'bob@baumeister.de', amount: '50', memo: 'Das ist für dich, Bob' }, + variables: { + recipientIdentifier: 'bob@baumeister.de', + amount: '50', + memo: 'Das ist für dich, Bob', + }, }) await mutate({ mutation: login, @@ -172,7 +176,11 @@ describe('semaphore', () => { }) const bobsTransaction = mutate({ mutation: sendCoins, - variables: { identifier: 'bibi@bloxberg.de', amount: '50', memo: 'Das ist für dich, Bibi' }, + variables: { + recipientIdentifier: 'bibi@bloxberg.de', + amount: '50', + memo: 'Das ist für dich, Bibi', + }, }) await mutate({ mutation: login, diff --git a/frontend/src/components/GddSend/TransactionForm.spec.js b/frontend/src/components/GddSend/TransactionForm.spec.js index d8db5e6ae..bc9dfa93f 100644 --- a/frontend/src/components/GddSend/TransactionForm.spec.js +++ b/frontend/src/components/GddSend/TransactionForm.spec.js @@ -5,7 +5,6 @@ import { SEND_TYPES } from '@/pages/Send' import { createMockClient } from 'mock-apollo-client' import VueApollo from 'vue-apollo' import { user as userQuery, selectCommunities as selectCommunitiesQuery } from '@/graphql/queries' -import { COMMUNITY_NAME } from '@/config' const mockClient = createMockClient() const apolloProvider = new VueApollo({