Skip to content

Commit 32556cd

Browse files
authored
Test Additions (#1339)
* Add NonArray setAdditionalSelects Test * Update for FrontendAssets Test * Fix styling --------- Co-authored-by: lrljoe <[email protected]>
1 parent 4ee351e commit 32556cd

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

src/Traits/Mechanisms/WithRappasoftTableScripts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static function tableJs(array $options = []): string
7575
);
7676

7777
return <<<HTML
78-
<script src="{$url}" {$nonce} {$extraAttributes}></script>
78+
<script src="{$url}" {$nonce} {$extraAttributes}></script>
7979
HTML;
8080
}
8181
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
namespace Rappasoft\LaravelLivewireTables\Tests\Mechanisms;
4+
5+
use Rappasoft\LaravelLivewireTables\Mechanisms\RappasoftFrontendAssets;
6+
use Rappasoft\LaravelLivewireTables\Tests\TestCase;
7+
8+
class RappasoftFrontendAssetsTest extends TestCase
9+
{
10+
/** @test */
11+
public function styles()
12+
{
13+
$assets = app(RappasoftFrontendAssets::class);
14+
15+
$this->assertFalse($assets->hasRenderedRappsoftTableStyles);
16+
17+
$this->assertStringStartsWith('<link href="/rappasoft/laravel-livewire-tables/core.min.css" rel="stylesheet" />', ltrim($assets->tableStyles()));
18+
19+
$this->assertTrue($assets->hasRenderedRappsoftTableStyles);
20+
}
21+
22+
/** @test */
23+
public function scripts()
24+
{
25+
$assets = app(RappasoftFrontendAssets::class);
26+
27+
$this->assertFalse($assets->hasRenderedRappsoftTableScripts);
28+
29+
$this->assertStringStartsWith('<script src="', $assets->tableScripts());
30+
31+
$this->assertTrue($assets->hasRenderedRappsoftTableScripts);
32+
}
33+
}

0 commit comments

Comments
 (0)