Skip to content

Commit

Permalink
Add unit check for page changeTitle dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Sep 12, 2024
1 parent 8dffe45 commit b599a69
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/Panel/Areas/PageDialogsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ public function testChangeTitle(): void
$this->assertFalse($props['fields']['title']['disabled']);
$this->assertSame('URL appendix', $props['fields']['slug']['label']);
$this->assertFalse($props['fields']['slug']['disabled']);
$this->assertSame('/', $props['fields']['slug']['path']);
$this->assertSame('Create from title', $props['fields']['slug']['wizard']['text']);
$this->assertSame('title', $props['fields']['slug']['wizard']['field']);

Expand All @@ -351,6 +352,31 @@ public function testChangeTitle(): void
$this->assertSame('Change', $props['submitButton']);
}

public function testChangeTitlePathWithParent(): void
{
$this->app([
'site' => [
'children' => [
[
'slug' => 'a',
'children' => [
['slug' => 'b']
]
]
]
]
]);

$this->login();

$dialog = $this->dialog('pages/a+b/changeTitle');
$props = $dialog['props'];

$this->assertFormDialog($dialog);

$this->assertSame('/a/', $props['fields']['slug']['path']);
}

public function testChangeTitleOnSubmit(): void
{
$this->app([
Expand Down

0 comments on commit b599a69

Please sign in to comment.