Skip to content

Commit

Permalink
fix(pay): force react types path (#4450)
Browse files Browse the repository at this point in the history
  • Loading branch information
dolcalmi authored May 10, 2024
1 parent ab8689b commit 1d675b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
23 changes: 15 additions & 8 deletions apps/pay/cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// <reference types="cypress" />
/* eslint-disable @typescript-eslint/no-explicit-any */
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
Expand Down Expand Up @@ -35,17 +36,23 @@
// }
// }

// eslint-disable-next-line @typescript-eslint/no-namespace

// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable<Subject> {
flushRedis(): Chainable<void>
loginAndGetToken(phone: string, code: string): Chainable<string>
graphqlOperation(query: string, variables?: Record<string, unknown>, token: string)
fetchMe(token: string)
sendInvoicePayment(paymentRequest: string, walletId: string, token: string)
graphqlOperation(
query: string,
token: string,
variables?: Record<string, unknown>,
): Chainable<Response<any>>
fetchMe(token: string): Chainable<Response<any>>
sendInvoicePayment(
paymentRequest: string,
walletId: string,
token: string,
): Chainable<Response<any>>
}
}

Expand Down Expand Up @@ -75,7 +82,7 @@ Cypress.Commands.add("loginAndGetToken", (phone, code) => {
})
})

Cypress.Commands.add("graphqlOperation", (query, variables = {}, token) => {
Cypress.Commands.add("graphqlOperation", (query, token, variables = {}) => {
return cy.request({
method: "POST",
url: "http://localhost:4455/graphql",
Expand Down Expand Up @@ -103,7 +110,7 @@ Cypress.Commands.add("fetchMe", (token) => {
}
}
`
return cy.graphqlOperation(query, {}, token)
return cy.graphqlOperation(query, token, {})
})

Cypress.Commands.add("sendInvoicePayment", (paymentRequest, walletId, token) => {
Expand All @@ -125,5 +132,5 @@ Cypress.Commands.add("sendInvoicePayment", (paymentRequest, walletId, token) =>
walletId,
},
}
return cy.graphqlOperation(mutation, variables, token)
return cy.graphqlOperation(mutation, token, variables)
})
3 changes: 2 additions & 1 deletion apps/pay/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
}
],
"paths": {
"@/*": ["./*"]
"@/*": ["./*"],
"react": [ "./node_modules/@types/react" ]
}
},
"include": [
Expand Down

0 comments on commit 1d675b1

Please sign in to comment.