@@ -192,7 +192,7 @@ public function exportBulk($items)
192192 })->assertDontSee ('Bulk Actions ' );
193193 }
194194
195- public function test_bulk_dropdown_can_have_customised_classes (): void
195+ public function test_bulk_dropdown_can_have_customised_classes_with_no_defaults (): void
196196 {
197197 Livewire::test (new class extends PetsTable
198198 {
@@ -202,7 +202,7 @@ public function configure(): void
202202 $ this ->setBulkActionsThAttributes ([
203203 'class ' => 'bg-yellow-500 dark:bg-yellow-800 ' ,
204204 'default ' => false ,
205- 'default-styling ' => true ,
205+ 'default-styling ' => false ,
206206 'default-colors ' => false ,
207207 ]);
208208
@@ -224,4 +224,106 @@ public function exportBulk($items)
224224 'wire:key="table-thead-bulk-actions" ' ,
225225 ]);
226226 }
227+
228+ public function test_bulk_dropdown_can_have_customised_classes_with_default_styling (): void
229+ {
230+ Livewire::test (new class extends PetsTable
231+ {
232+ public function configure (): void
233+ {
234+ $ this ->setPrimaryKey ('id ' );
235+ $ this ->setBulkActionsThAttributes ([
236+ 'class ' => 'bg-yellow-500 dark:bg-yellow-800 ' ,
237+ 'default ' => false ,
238+ 'default-styling ' => true ,
239+ 'default-colors ' => false ,
240+ ]);
241+
242+ }
243+
244+ public function bulkActions (): array
245+ {
246+ return ['exportBulk ' => 'exportBulk ' ];
247+ }
248+
249+ public function exportBulk ($ items )
250+ {
251+ return $ items ;
252+ }
253+ })->assertSee ('Bulk Actions ' )
254+ ->assertSeeHtmlInOrder ([
255+ 'scope="col" ' ,
256+ 'class="table-cell px-3 py-2 md:px-6 md:py-3 text-center md:text-left laravel-livewire-tables-reorderingMinimised bg-yellow-500 dark:bg-yellow-800" ' ,
257+ 'wire:key="table-thead-bulk-actions" ' ,
258+ ]);
259+ }
260+
261+
262+ public function test_bulk_dropdown_can_have_customised_classes_with_default_colors (): void
263+ {
264+ Livewire::test (new class extends PetsTable
265+ {
266+ public function configure (): void
267+ {
268+ $ this ->setPrimaryKey ('id ' );
269+ $ this ->setBulkActionsThAttributes ([
270+ 'class ' => 'text-lg ' ,
271+ 'default ' => false ,
272+ 'default-styling ' => false ,
273+ 'default-colors ' => true ,
274+ ]);
275+
276+ }
277+
278+ public function bulkActions (): array
279+ {
280+ return ['exportBulk ' => 'exportBulk ' ];
281+ }
282+
283+ public function exportBulk ($ items )
284+ {
285+ return $ items ;
286+ }
287+ })->assertSee ('Bulk Actions ' )
288+ ->assertSeeHtmlInOrder ([
289+ 'scope="col" ' ,
290+ 'class="bg-gray-50 dark:bg-gray-800 text-lg" ' ,
291+ 'wire:key="table-thead-bulk-actions" ' ,
292+ ]);
293+ }
294+
295+ public function test_bulk_dropdown_can_have_customised_classes_with_defaults (): void
296+ {
297+ Livewire::test (new class extends PetsTable
298+ {
299+ public function configure (): void
300+ {
301+ $ this ->setPrimaryKey ('id ' );
302+ $ this ->setBulkActionsThAttributes ([
303+ 'class ' => 'text-lg ' ,
304+ 'default ' => true ,
305+ 'default-styling ' => true ,
306+ 'default-colors ' => true ,
307+ ]);
308+
309+ }
310+
311+ public function bulkActions (): array
312+ {
313+ return ['exportBulk ' => 'exportBulk ' ];
314+ }
315+
316+ public function exportBulk ($ items )
317+ {
318+ return $ items ;
319+ }
320+ })->assertSee ('Bulk Actions ' )
321+ ->assertSeeHtmlInOrder ([
322+ 'scope="col" ' ,
323+ 'class="table-cell px-3 py-2 md:px-6 md:py-3 text-center md:text-left laravel-livewire-tables-reorderingMinimised bg-gray-50 dark:bg-gray-800 text-lg" ' ,
324+ 'wire:key="table-thead-bulk-actions" ' ,
325+ ]);
326+ }
327+
328+
227329}
0 commit comments