[Operator] Perbaikan Halaman Pegawai dan Export Excel
This commit is contained in:
@@ -57,7 +57,7 @@ class LoginTest extends TestCase
|
||||
$this->assertSame(1, $xpath->query("//form//input[@name='remember'][@type='checkbox']")->length);
|
||||
$this->assertSame(1, $xpath->query("//form//input[@name='_token']")->length);
|
||||
|
||||
$this->assertStringContainsString('Username / NIM / NIP', $formText);
|
||||
$this->assertStringContainsString('NIM, NIDN, NIP, atau username', $formText);
|
||||
$this->assertStringContainsString('Kata sandi', $formText);
|
||||
$this->assertStringContainsString('Ingat saya', $formText);
|
||||
|
||||
@@ -70,10 +70,12 @@ class LoginTest extends TestCase
|
||||
{
|
||||
$response = $this->get(route('login'));
|
||||
|
||||
$response->assertDontSee('Lupa', false);
|
||||
$response->assertDontSee('Daftar', false);
|
||||
$response->assertDontSee('href="#"', false);
|
||||
$this->assertSame(0, $this->dom($response)->query('//a[not(@href)]')->length);
|
||||
$xpath = $this->dom($response);
|
||||
// Petunjuk lupa kata sandi hanya teks, bukan tautan.
|
||||
$this->assertSame(0, $xpath->query("//a[contains(., 'Lupa')]")->length);
|
||||
$this->assertSame(0, $xpath->query('//a[not(@href)]')->length);
|
||||
}
|
||||
|
||||
#[DataProvider('roles')]
|
||||
@@ -275,9 +277,9 @@ class LoginTest extends TestCase
|
||||
$this->followingRedirects()->get('/')->assertOk()->assertSee('Selamat Datang,');
|
||||
}
|
||||
|
||||
public function test_demo_accounts_panel_is_absent_outside_local(): void
|
||||
public function test_login_page_never_lists_demo_accounts(): void
|
||||
{
|
||||
foreach (['testing', 'production', 'staging'] as $environment) {
|
||||
foreach (['local', 'testing', 'production', 'staging'] as $environment) {
|
||||
$this->app->detectEnvironment(fn (): string => $environment);
|
||||
|
||||
$this->get(route('login'))
|
||||
@@ -285,22 +287,4 @@ class LoginTest extends TestCase
|
||||
->assertDontSee('Akun demo');
|
||||
}
|
||||
}
|
||||
|
||||
public function test_demo_accounts_panel_lists_the_five_roles_in_local(): void
|
||||
{
|
||||
$this->app->detectEnvironment(fn (): string => 'local');
|
||||
|
||||
$response = $this->get(route('login'))->assertOk()->assertSee('Akun demo');
|
||||
$xpath = $this->dom($response);
|
||||
|
||||
$details = $xpath->query('//details');
|
||||
$this->assertSame(1, $details->length);
|
||||
$panel = $this->textOf($details->item(0));
|
||||
|
||||
foreach (Role::cases() as $role) {
|
||||
$this->assertStringContainsString($role->label(), $panel);
|
||||
$this->assertStringContainsString($role->value, $panel);
|
||||
}
|
||||
$this->assertSame(5, $xpath->query('//details//button')->length);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user