1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-08 23:15:24 +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
.request({
.apiRequest({
method: 'POST',
url: `${Cypress.env('API_URL')}/stripe/webhook`,
url: '/stripe/webhook',
headers: {
['stripe-signature']: signature,
},

View file

@ -1,6 +1,29 @@
import './commands'
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({
method: 'GET',
url: 'api/auth/csrf',
@ -31,22 +54,4 @@ beforeEach(() => {
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)
})
})
}