From 30d79462725aecb4651d614b2992e7754e27ef41 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Tue, 24 Sep 2024 10:50:22 +0200 Subject: [PATCH] Add another unit test --- tests/Panel/Areas/UsersDialogsTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Panel/Areas/UsersDialogsTest.php b/tests/Panel/Areas/UsersDialogsTest.php index b1581f1eaa..17995a95ce 100644 --- a/tests/Panel/Areas/UsersDialogsTest.php +++ b/tests/Panel/Areas/UsersDialogsTest.php @@ -35,6 +35,26 @@ public function testCreate(): void $this->assertSame('admin', $props['value']['role']); } + public function testCreateWithRoleQuery(): void + { + $this->app = $this->app->clone([ + 'request' => [ + 'query' => [ + 'role' => 'editor', + ] + ] + ]); + + $this->installEditor(); + $this->login(); + + $dialog = $this->dialog('users/create'); + $props = $dialog['props']; + + $this->assertFormDialog($dialog); + $this->assertSame('editor', $props['value']['role']); + } + public function testCreateOnSubmit(): void { $this->submit([