forked from rappasoft/laravel-livewire-tables
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
158 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
namespace Rappasoft\LaravelLivewireTables\Tests\Unit\Traits\Helpers; | ||
|
||
use Rappasoft\LaravelLivewireTables\Tests\Models\Pet; | ||
use Rappasoft\LaravelLivewireTables\Tests\TestCase; | ||
|
||
final class ConfigurableAreaHelpersTest extends TestCase | ||
{ | ||
public function test_can_get_configurable_areas(): void | ||
{ | ||
$this->assertEquals([ | ||
'before-tools' => null, | ||
'toolbar-left-start' => null, | ||
'toolbar-left-end' => null, | ||
'toolbar-right-start' => null, | ||
'toolbar-right-end' => null, | ||
'before-toolbar' => null, | ||
'after-toolbar' => null, | ||
'after-tools' => null, | ||
'before-pagination' => null, | ||
'after-pagination' => null, | ||
], $this->basicTable->getConfigurableAreas()); | ||
|
||
$this->basicTable->setConfigurableAreas([ | ||
'toolbar-left-start' => 'includes.areas.toolbar-left-start', | ||
]); | ||
|
||
$this->assertEquals('includes.areas.toolbar-left-start', $this->basicTable->getConfigurableAreaFor('toolbar-left-start')); | ||
|
||
$this->basicTable->setConfigurableAreas([ | ||
'toolbar-left-start' => ['includes.areas.toolbar-left-start', ['param1' => 'hello']], | ||
]); | ||
|
||
$this->assertEquals('includes.areas.toolbar-left-start', $this->basicTable->getConfigurableAreaFor('toolbar-left-start')); | ||
} | ||
|
||
public function test_can_get_configurable_area_parameters(): void | ||
{ | ||
$this->basicTable->setConfigurableAreas([ | ||
'toolbar-left-start' => 'includes.areas.toolbar-left-start', | ||
]); | ||
|
||
$this->assertEquals([], $this->basicTable->getParametersForConfigurableArea('toolbar-left-start')); | ||
|
||
$this->basicTable->setConfigurableAreas([ | ||
'toolbar-left-start' => ['includes.areas.toolbar-left-start', ['param1' => 'hello']], | ||
]); | ||
|
||
$this->assertEquals(['param1' => 'hello'], $this->basicTable->getParametersForConfigurableArea('toolbar-left-start')); | ||
} | ||
|
||
public function test_can_get_hide_configurable_areas_when_reordering_status(): void | ||
{ | ||
$this->assertTrue($this->basicTable->getHideConfigurableAreasWhenReorderingStatus()); | ||
|
||
$this->assertTrue($this->basicTable->hideConfigurableAreasWhenReorderingIsEnabled()); | ||
|
||
$this->basicTable->setHideConfigurableAreasWhenReorderingDisabled(); | ||
|
||
$this->assertTrue($this->basicTable->hideConfigurableAreasWhenReorderingIsDisabled()); | ||
|
||
$this->assertFalse($this->basicTable->hideConfigurableAreasWhenReorderingIsEnabled()); | ||
|
||
$this->basicTable->setHideConfigurableAreasWhenReorderingEnabled(); | ||
|
||
$this->assertTrue($this->basicTable->hideConfigurableAreasWhenReorderingIsEnabled()); | ||
|
||
$this->assertFalse($this->basicTable->hideConfigurableAreasWhenReorderingIsDisabled()); | ||
} | ||
|
||
} |