Skip to content

Commit 9ec84f1

Browse files
authored
Add Third Party Tests (#1340)
* Add NonArray setAdditionalSelects Test * Update for FrontendAssets Test * Add ThirdPartyScripts/Styles to Test * Fix styling --------- Co-authored-by: lrljoe <[email protected]>
1 parent 32556cd commit 9ec84f1

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/Traits/Mechanisms/WithRappasoftTableThirdPartyScripts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function tableThirdpartyJs(array $options = []): string
7373
);
7474

7575
return <<<HTML
76-
<script src="{$url}" type="module" {$nonce} {$extraAttributes}></script>
76+
<script src="{$url}" type="module" {$nonce} {$extraAttributes}></script>
7777
HTML;
7878
}
7979
}

tests/Mechanisms/RappasoftFrontendAssetsTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,28 @@ public function scripts()
3030

3131
$this->assertTrue($assets->hasRenderedRappsoftTableScripts);
3232
}
33+
34+
/** @test */
35+
public function thirdPartystyles()
36+
{
37+
$assets = app(RappasoftFrontendAssets::class);
38+
39+
$this->assertFalse($assets->hasRenderedRappsoftTableThirdPartyStyles);
40+
41+
$this->assertStringStartsWith('<link href="/rappasoft/laravel-livewire-tables/thirdparty.css" rel="stylesheet" />', ltrim($assets->tableThirdPartyStyles()));
42+
43+
$this->assertTrue($assets->hasRenderedRappsoftTableThirdPartyStyles);
44+
}
45+
46+
/** @test */
47+
public function thirdPartyscripts()
48+
{
49+
$assets = app(RappasoftFrontendAssets::class);
50+
51+
$this->assertFalse($assets->hasRenderedRappsoftTableThirdPartyScripts);
52+
53+
$this->assertStringStartsWith('<script src="', $assets->tableThirdPartyScripts());
54+
55+
$this->assertTrue($assets->hasRenderedRappsoftTableThirdPartyScripts);
56+
}
3357
}

0 commit comments

Comments
 (0)