test: cover credential-clearing and trailing-slash URL edge cases
Also fixes a missing trailing newline in SiteResource.php.
This commit is contained in:
@@ -105,3 +105,17 @@ test('WordPress app password can be revealed and hidden in the table', function
|
||||
->call('toggleReveal', $site->id)
|
||||
->assertSet('revealedId', null);
|
||||
});
|
||||
|
||||
test('switching a WordPress site to a non-WordPress cms_type clears its credentials', function () {
|
||||
$site = Site::factory()->wordpress()->create(['wp_username' => 'admin']);
|
||||
|
||||
Livewire::test(Index::class)
|
||||
->call('edit', $site->id)
|
||||
->set('cmsType', 'custom')
|
||||
->call('save');
|
||||
|
||||
expect($site->fresh())
|
||||
->cms_type->toBe('custom')
|
||||
->wp_username->toBeNull()
|
||||
->wp_app_password->toBeNull();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user