Skip to content

Commit

Permalink
small e2e updates
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBigBoss committed Jul 24, 2024
1 parent 04aae9f commit 7f140f8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ test('can refer a tag', async ({
// ensure receipts are created
const { data: checkoutReceipt, error: checkoutReceiptError } =
await fetchSendtagCheckoutReceipts(supabase).single()

expect(checkoutReceiptError).toBeFalsy()
expect(checkoutReceipt).toBeTruthy()
assert(!!checkoutReceipt?.event_id, 'checkout receipt event id not found')
expect(BigInt(checkoutReceipt?.amount)).toBe(total(tags))
Expand Down
17 changes: 11 additions & 6 deletions packages/playwright/tests/fixtures/checkout/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,18 @@ export class CheckoutPage {
async confirmTags(expect: Expect<CheckoutPage>) {
// sign transaction
log('sign transaction')
const confirmTagsRequest = this.page.waitForRequest((request) => {
if (request.url().includes('/api/trpc/tag.confirm')) {
log('confirmTags request', request.url(), request.method(), request.postDataJSON())
return request.url().includes('/api/trpc/tag.confirm') && request.method() === 'POST'
const confirmTagsRequest = this.page.waitForRequest(
(request) => {
if (request.url().includes('/api/trpc/tag.confirm')) {
log('confirmTags request', request.url(), request.method(), request.postDataJSON())
return request.url().includes('/api/trpc/tag.confirm') && request.method() === 'POST'
}
return false
},
{
timeout: 15_000,
}
return false
})
)
const confirmTagsResponse = this.page.waitForEvent('response', async (response) => {
const json = await response.json().catch(() => ({}))
if (response.url().includes('/api/trpc/tag.confirm')) {
Expand Down

0 comments on commit 7f140f8

Please sign in to comment.