Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/UsersTest.php
Show First 20 Lines • Show All 317 Lines • ▼ Show 20 Lines | public function testInfo(): void | ||||
->assertMissing('#password') | ->assertMissing('#password') | ||||
->assertMissing('#password_confirmation') | ->assertMissing('#password_confirmation') | ||||
->assertMissing('#pass-mode-link:checked') | ->assertMissing('#pass-mode-link:checked') | ||||
->assertMissing('#pass-mode-input:checked') | ->assertMissing('#pass-mode-input:checked') | ||||
->assertSeeIn('#password-link code', $link) | ->assertSeeIn('#password-link code', $link) | ||||
->assertVisible('#password-link button.text-danger') | ->assertVisible('#password-link button.text-danger') | ||||
->assertVisible('#password-link button:not(.text-danger)') | ->assertVisible('#password-link button:not(.text-danger)') | ||||
->assertAttribute('#password-link button:not(.text-danger)', 'title', 'Copy') | ->assertAttribute('#password-link button:not(.text-danger)', 'title', 'Copy') | ||||
->assertAttribute('#password-link button.text-danger', 'title', 'Delete'); | ->assertAttribute('#password-link button.text-danger', 'title', 'Delete') | ||||
->assertMissing('#password-link div.form-text'); | |||||
// Test deleting an existing password reset link | // Test deleting an existing password reset link | ||||
$browser->click('#password-link button.text-danger') | $browser->click('#password-link button.text-danger') | ||||
->assertToast(Toast::TYPE_SUCCESS, 'Password reset code deleted successfully.') | ->assertToast(Toast::TYPE_SUCCESS, 'Password reset code deleted successfully.') | ||||
->assertMissing('#password-link') | ->assertMissing('#password-link') | ||||
->assertMissing('#pass-mode-link:checked') | ->assertMissing('#pass-mode-link:checked') | ||||
->assertMissing('#pass-mode-input:checked') | ->assertMissing('#pass-mode-input:checked') | ||||
->assertMissing('#password'); | ->assertMissing('#password'); | ||||
$this->assertSame(0, $jack->verificationcodes()->count()); | $this->assertSame(0, $jack->verificationcodes()->count()); | ||||
// Test creating a password reset link | // Test creating a password reset link | ||||
$link = preg_replace('|/[a-z0-9A-Z-]+$|', '', $link) . '/'; | $link = preg_replace('|/[a-z0-9A-Z-]+$|', '', $link) . '/'; | ||||
$browser->click('#pass-mode-link + label') | $browser->click('#pass-mode-link + label') | ||||
->assertMissing('#password') | ->assertMissing('#password') | ||||
->assertMissing('#password_confirmation') | ->assertMissing('#password_confirmation') | ||||
->waitFor('#password-link code') | ->waitFor('#password-link code') | ||||
->assertSeeIn('#password-link code', $link); | ->assertSeeIn('#password-link code', $link) | ||||
->assertSeeIn('#password-link div.form-text', "Press Submit to activate the link"); | |||||
// Test copy to clipboard | // Test copy to clipboard | ||||
/* TODO: Figure out how to give permission to do this operation | /* TODO: Figure out how to give permission to do this operation | ||||
$code = $john->verificationcodes()->first(); | $code = $john->verificationcodes()->first(); | ||||
$link .= $code->short_code . '-' . $code->code; | $link .= $code->short_code . '-' . $code->code; | ||||
$browser->assertMissing('#password-link button.text-danger') | $browser->assertMissing('#password-link button.text-danger') | ||||
->click('#password-link button:not(.text-danger)') | ->click('#password-link button:not(.text-danger)') | ||||
▲ Show 20 Lines • Show All 541 Lines • Show Last 20 Lines |