Use the same pattern: make the Dusk test fail on the real validation/database issue, not just a missing text wait.
This commit is contained in:
@@ -31,23 +31,32 @@ class PlatformAdministrationBrowserTest extends DuskTestCase
|
||||
{
|
||||
$admin = $this->platformAdminUser();
|
||||
|
||||
$companyName = 'Abbott Logistics '.uniqid();
|
||||
$billingEmail = 'billing+'.uniqid().'@abbott.example';
|
||||
$unique = str_replace('.', '', uniqid('', true));
|
||||
$companyName = 'Abbott Logistics '.$unique;
|
||||
$billingEmail = 'billing+'.$unique.'@abbott.example';
|
||||
|
||||
$this->browse(function (Browser $browser) use ($admin, $companyName, $billingEmail): void {
|
||||
$browser->loginAs($admin)
|
||||
->visit('/admin/companies');
|
||||
|
||||
$this->assertSingleProfessionalHeader($browser, 'Companies');
|
||||
|
||||
$browser->type('name', $companyName)
|
||||
->type('billing_email', $billingEmail)
|
||||
->select('status', 'active')
|
||||
->press('Create')
|
||||
->waitForText($companyName, 10)
|
||||
->waitForReload()
|
||||
->assertPathIs('/admin/companies')
|
||||
->waitForText('Companies', 10)
|
||||
->assertSee($companyName);
|
||||
});
|
||||
}
|
||||
|
||||
$this->assertDatabaseHas('companies', [
|
||||
'name' => $companyName,
|
||||
'billing_email' => $billingEmail,
|
||||
'status' => 'active',
|
||||
]);
|
||||
}
|
||||
public function test_license_administration_form_issues_license(): void
|
||||
{
|
||||
$admin = $this->platformAdminUser();
|
||||
|
||||
Reference in New Issue
Block a user