1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-09 07:25:19 +02:00
This commit is contained in:
Tyler Myracle 2024-01-22 09:31:03 -06:00
parent 2677f7c3d3
commit 1cf2b5d057
2 changed files with 26 additions and 21 deletions

View file

@ -19,9 +19,9 @@ function sendWebhook(payload: Record<string, any>) {
}) })
return cy return cy
.request({ .apiRequest({
method: 'POST', method: 'POST',
url: `${Cypress.env('API_URL')}/stripe/webhook`, url: '/stripe/webhook',
headers: { headers: {
['stripe-signature']: signature, ['stripe-signature']: signature,
}, },

View file

@ -1,6 +1,29 @@
import './commands' import './commands'
beforeEach(() => { beforeEach(() => {
authenticateCIUser()
cy.apiRequest({
method: 'POST',
url: 'e2e/reset',
body: {},
}).then((response) => {
expect(response.status).to.equal(200)
})
cy.visit('/')
})
after(() => {
authenticateCIUser()
cy.apiRequest({
method: 'POST',
url: 'e2e/clean',
body: {},
}).then((response) => {
expect(response.status).to.equal(200)
})
})
function authenticateCIUser() {
cy.request({ cy.request({
method: 'GET', method: 'GET',
url: 'api/auth/csrf', url: 'api/auth/csrf',
@ -31,22 +54,4 @@ beforeEach(() => {
expect(response.status).to.equal(200) expect(response.status).to.equal(200)
}) })
}) })
cy.apiRequest({ }
method: 'POST',
url: 'e2e/reset',
body: {},
}).then((response) => {
expect(response.status).to.equal(200)
})
cy.visit('/')
})
after(() => {
cy.apiRequest({
method: 'POST',
url: 'e2e/clean',
body: {},
}).then((response) => {
expect(response.status).to.equal(200)
})
})