Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/PaymentStripeTest.php
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | public function testPayment(): void | ||||
->assertSeeIn('#amount + span + .invalid-feedback', 'The amount must be a number.') | ->assertSeeIn('#amount + span + .invalid-feedback', 'The amount must be a number.') | ||||
// Submit valid data | // Submit valid data | ||||
->type('@body #amount', '12.34') | ->type('@body #amount', '12.34') | ||||
// Note we use double click to assert it does not create redundant requests | // Note we use double click to assert it does not create redundant requests | ||||
->click('@button-action') | ->click('@button-action') | ||||
->click('@button-action'); | ->click('@button-action'); | ||||
}) | }) | ||||
->on(new PaymentStripe()) | ->on(new PaymentStripe()) | ||||
->assertSeeIn('@title', \config('app.name') . ' Payment') | ->assertSeeIn('@title', $user->tenant->title . ' Payment') | ||||
->assertSeeIn('@amount', 'CHF 12.34') | ->assertSeeIn('@amount', 'CHF 12.34') | ||||
->assertValue('@email-input', $user->email) | ->assertValue('@email-input', $user->email) | ||||
->submitValidCreditCard(); | ->submitValidCreditCard(); | ||||
// Now it should redirect back to wallet page and in background | // Now it should redirect back to wallet page and in background | ||||
// use the webhook to update payment status (and balance). | // use the webhook to update payment status (and balance). | ||||
// Looks like in test-mode the webhook is executed before redirect | // Looks like in test-mode the webhook is executed before redirect | ||||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |