diff --git a/tests/Unit/Views/ColumnTest.php b/tests/Unit/Views/ColumnTest.php index c15b58374..3c9ff0d71 100644 --- a/tests/Unit/Views/ColumnTest.php +++ b/tests/Unit/Views/ColumnTest.php @@ -114,4 +114,26 @@ public function test_cannot_collapse_on_tablet_and_mobile(): void $contents = $column->renderContents($rows->first()); } + + public function test_custom_sorting_pills_defaults_correctly(): void + { + $column = Column::make('Name', 'name'); + $defaultString = __($this->basicTable->getLocalisationPath().'not_applicable'); + + $this->assertSame('A-Z', $column->getCustomSortingPillDirections('asc')); + $this->assertSame('Z-A', $column->getCustomSortingPillDirections('desc')); + $this->assertSame($defaultString, $column->getCustomSortingPillDirections('faulty_string')); + + } + + public function test_custom_sorting_pills_label_defaults_correctly(): void + { + $column = Column::make('Name', 'name'); + $defaultString = __($this->basicTable->getLocalisationPath().'not_applicable'); + + $this->assertSame('A-Z', $column->getCustomSortingPillDirectionsLabel('asc')); + $this->assertSame('Z-A', $column->getCustomSortingPillDirectionsLabel('desc')); + $this->assertSame($defaultString, $column->getCustomSortingPillDirectionsLabel('faulty_string')); + + } }