Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/SignupTest.php
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | public function testSignupCodeByLink(): void | ||||
// either display 1st step or 404 error page | // either display 1st step or 404 error page | ||||
$browser->waitFor('@step1') | $browser->waitFor('@step1') | ||||
->assertToast(Toast::TYPE_ERROR, 'Form validation error'); | ->assertToast(Toast::TYPE_ERROR, 'Form validation error'); | ||||
}); | }); | ||||
// Test valid code | // Test valid code | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$code = SignupCode::create([ | $code = SignupCode::create([ | ||||
'data' => [ | |||||
'email' => 'User@example.org', | 'email' => 'User@example.org', | ||||
'first_name' => 'User', | 'first_name' => 'User', | ||||
'last_name' => 'Name', | 'last_name' => 'Name', | ||||
'plan' => 'individual', | 'plan' => 'individual', | ||||
'voucher' => '', | 'voucher' => '', | ||||
] | |||||
]); | ]); | ||||
$browser->visit('/signup/' . $code->short_code . '-' . $code->code) | $browser->visit('/signup/' . $code->short_code . '-' . $code->code) | ||||
->waitFor('@step3') | ->waitFor('@step3') | ||||
->assertMissing('@step1') | ->assertMissing('@step1') | ||||
->assertMissing('@step2'); | ->assertMissing('@step2'); | ||||
// FIXME: Find a nice way to read javascript data without using hidden inputs | // FIXME: Find a nice way to read javascript data without using hidden inputs | ||||
▲ Show 20 Lines • Show All 456 Lines • Show Last 20 Lines |