Skip to content

Commit 6438170

Browse files
Alitindrawan24Kovah
authored andcommitted
test(guest/tag): add tag search test cases
1 parent e02fba6 commit 6438170

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/Controller/Guest/TagControllerTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,22 @@ public function test_invalid_tag_detail_response(): void
6767
$this->get('guest/tags/1')->assertNotFound();
6868
$this->get('guest/tags/myTag')->assertNotFound();
6969
}
70+
71+
public function test_tag_search(): void
72+
{
73+
User::factory()->create();
74+
Tag::factory()->create([
75+
'name' => 'testTag1',
76+
'visibility' => 1,
77+
]);
78+
Tag::factory()->create([
79+
'name' => 'testTag2',
80+
'visibility' => 1,
81+
]);
82+
$this->get('guest/tags?filter=testTag1')->assertSee('testTag1')
83+
->assertDontSee('testTag2');
84+
85+
$this->get('guest/tags?filter=testTag2')->assertSee('testTag2')
86+
->assertDontSee('testTag1');
87+
}
7088
}

0 commit comments

Comments
 (0)