@@ -41,6 +41,20 @@ public function it_shows_authors_grid(): void
4141 $ this ->assertCount (10 , $ this ->getAuthorNamesFromResponse ());
4242 }
4343
44+ /** @test */
45+ public function it_shows_authors_ids (): void
46+ {
47+ $ this ->client ->request ('GET ' , '/authors/?limit=100 ' );
48+
49+ $ ids = $ this ->getAuthorIdsFromResponse ();
50+
51+ $ this ->assertNotEmpty ($ ids );
52+ $ this ->assertSame (
53+ array_filter ($ ids , fn (string $ id ) => str_starts_with ($ id , '# ' )),
54+ $ ids ,
55+ );
56+ }
57+
4458 /** @test */
4559 public function it_sorts_authors_by_name_ascending_by_default (): void
4660 {
@@ -98,7 +112,7 @@ public function it_filters_books_by_title(): void
98112 $ titles = $ this ->getBookTitlesFromResponse ();
99113
100114 $ this ->assertCount (1 , $ titles );
101- $ this ->assertSame ('Book 5 ' , $ titles [0 ]);
115+ $ this ->assertSame ('BOOK 5 ' , $ titles [0 ]);
102116 }
103117
104118 /** @test */
@@ -112,7 +126,7 @@ public function it_filters_books_by_title_with_contains(): void
112126 $ titles = $ this ->getBookTitlesFromResponse ();
113127
114128 $ this ->assertCount (1 , $ titles );
115- $ this ->assertSame ('Jurassic Park ' , $ titles [0 ]);
129+ $ this ->assertSame ('JURASSIC PARK ' , $ titles [0 ]);
116130 }
117131
118132 /** @test */
@@ -125,7 +139,7 @@ public function it_filters_books_by_author(): void
125139 $ titles = $ this ->getBookTitlesFromResponse ();
126140
127141 $ this ->assertCount (2 , $ titles );
128- $ this ->assertSame ('Jurassic Park ' , $ titles [0 ]);
142+ $ this ->assertSame ('JURASSIC PARK ' , $ titles [0 ]);
129143 }
130144
131145 /** @test */
@@ -139,7 +153,7 @@ public function it_filters_books_by_authors(): void
139153 $ titles = $ this ->getBookTitlesFromResponse ();
140154
141155 $ this ->assertCount (3 , $ titles );
142- $ this ->assertSame ('A Study in Scarlet ' , $ titles [0 ]);
156+ $ this ->assertSame ('A STUDY IN SCARLET ' , $ titles [0 ]);
143157 }
144158
145159 /** @test */
@@ -152,7 +166,7 @@ public function it_filters_books_by_authors_nationality(): void
152166 $ titles = $ this ->getBookTitlesFromResponse ();
153167
154168 $ this ->assertCount (2 , $ titles );
155- $ this ->assertSame ('Jurassic Park ' , $ titles [0 ]);
169+ $ this ->assertSame ('JURASSIC PARK ' , $ titles [0 ]);
156170 }
157171
158172 /** @test */
@@ -165,7 +179,7 @@ public function it_filters_books_by_author_and_currency(): void
165179 $ titles = $ this ->getBookTitlesFromResponse ();
166180
167181 $ this ->assertCount (1 , $ titles );
168- $ this ->assertSame ('Jurassic Park ' , $ titles [0 ]);
182+ $ this ->assertSame ('JURASSIC PARK ' , $ titles [0 ]);
169183 }
170184
171185 /** @test */
@@ -274,6 +288,16 @@ private function getBookAuthorNationalitiesFromResponse(): array
274288 );
275289 }
276290
291+ /** @return string[] */
292+ private function getAuthorIdsFromResponse (): array
293+ {
294+ return $ this ->getCrawler ()
295+ ->filter ('[data-test-id] ' )
296+ ->each (
297+ fn (Crawler $ node ): string => $ node ->text (),
298+ );
299+ }
300+
277301 /** @return string[] */
278302 private function getAuthorNamesFromResponse (): array
279303 {
0 commit comments