Skip to content

Commit

Permalink
variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaOneOut36 committed Aug 29, 2024
1 parent e2d42aa commit 7192ef9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/backend/src/graphql/resolvers/incoming_payment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ describe('Incoming Payment Resolver', (): void => {

test.each`
id | metadata
${{incomingPayment}} |${{ description: 'rent', externalRef: '202201' }}
${undefined} |${{ description: 'Update metadata', status: 'COMPLETE' }}
${undefined} | ${new Date(Date.now() + 30_000)}
${undefined} | ${undefined}
`(
Expand All @@ -476,7 +476,6 @@ describe('Incoming Payment Resolver', (): void => {
expiresAt,
incomingAmount
})
console.log(payment)
const input = {
id:payment.id,
metadata
Expand Down Expand Up @@ -507,7 +506,7 @@ describe('Incoming Payment Resolver', (): void => {
})
.then(
(query): IncomingPaymentResponse =>
query.data?.createIncomingPayment
query.data?.updateIncomingPayment
)

expect(createSpy).toHaveBeenCalledWith(input)
Expand Down Expand Up @@ -540,7 +539,7 @@ describe('Incoming Payment Resolver', (): void => {

test('Errors when unknown wallet address', async (): Promise<void> => {
const createSpy = jest
.spyOn(incomingPaymentService, 'create')
.spyOn(incomingPaymentService, 'update')
.mockResolvedValueOnce(IncomingPaymentError.UnknownWalletAddress)

const input = {
Expand All @@ -567,7 +566,7 @@ describe('Incoming Payment Resolver', (): void => {
})
.then(
(query): IncomingPaymentResponse =>
query.data?.createIncomingPayment
query.data?.updateIncomingPayment
)
} catch (error) {
expect(error).toBeInstanceOf(ApolloError)
Expand All @@ -585,7 +584,7 @@ describe('Incoming Payment Resolver', (): void => {

test('Internal server error', async (): Promise<void> => {
const createSpy = jest
.spyOn(incomingPaymentService, 'create')
.spyOn(incomingPaymentService, 'update')
.mockRejectedValueOnce(new Error('unexpected'))

const input = {
Expand All @@ -612,7 +611,7 @@ describe('Incoming Payment Resolver', (): void => {
})
.then(
(query): IncomingPaymentResponse =>
query.data?.createIncomingPayment
query.data?.updateIncomingPayment
)
} catch (error) {
expect(error).toBeInstanceOf(ApolloError)
Expand Down

0 comments on commit 7192ef9

Please sign in to comment.