Skip to content

Commit

Permalink
Add basic column label status tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lrljoe authored Oct 18, 2023
1 parent a611071 commit 77f22fb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/Views/Traits/Helpers/ColumnHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,25 @@ public function can_check_if_column_has_footer(): void
$this->assertIsCallable($column->getFooterCallback());
$this->assertSame('Hi', $column->getFooterContents([]));
}

/** @test */
public function can_check_if_column_label_should_be_shown(): void
{
$column = Column::make('ID', 'id');

$this->assertTrue($column->getColumnLabelStatus());

$column2 = Column::make('ID', 'id')
->setColumnLabelStatusDisabled()
->footer(fn ($rows) => 'Hi');

$this->assertFalse($column2->getColumnLabelStatus());

$column3 = Column::make('ID', 'id')
->setColumnLabelStatusEnabled()
->footer(fn ($rows) => 'Hi');

$this->assertTrue($column3->getColumnLabelStatus());
$this->assertFalse($column2->getColumnLabelStatus());
}
}

0 comments on commit 77f22fb

Please sign in to comment.