Skip to content

Commit e5711ce

Browse files
authored
Reorder Initial Array - Add Additional Test
1 parent 0bfe53f commit e5711ce

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/Traits/Styling/HasToolsStyling.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ trait HasToolsStyling
1010
use ToolsStylingConfiguration,
1111
ToolsStylingHelpers;
1212

13-
protected array $toolsAttributes = ['default-styling' => true, 'default-colors' => true, 'class' => ''];
13+
protected array $toolsAttributes = ['class' => '', 'default-colors' => true, 'default-styling' => true];
1414

15-
protected array $toolBarAttributes = ['default-styling' => true, 'default-colors' => true, 'class' => ''];
15+
protected array $toolBarAttributes = ['class' => '', 'default-colors' => true, 'default-styling' => true];
1616
}

tests/Traits/Helpers/ToolsStylingHelpersTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ public function test_can_get_tools_attributes_initial_values(): void
1616
$this->assertSame(['class' => '', 'default-colors' => true, 'default-styling' => true], $this->basicTable->getToolsAttributesBag()->getAttributes());
1717
}
1818

19+
public function test_can_change_tools_attributes_initial_values(): void
20+
{
21+
$this->basicTable->setToolsAttributes(['class' => 'bg-red-500', 'default-colors' => true, 'default-styling' => true]);
22+
$this->assertSame(['class' => 'bg-red-500', 'default-colors' => true, 'default-styling' => true], $this->basicTable->getToolsAttributesBag()->getAttributes());
23+
}
24+
1925
public function test_can_get_toolbar_attributes_initial_status(): void
2026
{
2127
$this->assertTrue($this->basicTable->hasCustomAttributes('toolBarAttributes'));
@@ -25,4 +31,11 @@ public function test_can_get_toolbar_attributes_initial_values(): void
2531
{
2632
$this->assertSame(['class' => '', 'default-colors' => true, 'default-styling' => true], $this->basicTable->getToolBarAttributesBag()->getAttributes());
2733
}
34+
35+
public function test_can_change_toolbar_attributes_initial_values(): void
36+
{
37+
$this->basicTable->setToolBarAttributes(['class' => 'bg-blue-500', 'default-colors' => true, 'default-styling' => true]);
38+
$this->assertSame(['class' => 'bg-blue-500', 'default-colors' => true, 'default-styling' => true], $this->basicTable->getToolBarAttributesBag()->getAttributes());
39+
}
40+
2841
}

0 commit comments

Comments
 (0)