Skip to content

Commit

Permalink
Merge pull request #34 from codebar-ag/feature-v3
Browse files Browse the repository at this point in the history
main/feature-v3
  • Loading branch information
StanBarrows authored Jul 3, 2023
2 parents 3c3ac2a + 39165d2 commit cee413c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion resources/views/components/fathom.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
$siteId = config('laravel-default.services.fathom.site_id');
@endphp

@if(in_array(app()->environment(), $environments))
@if(in_array(app()->environment(), $environments) && $siteId)
<script src="{{ $url }}" data-site="{{ $siteId }}" defer></script>
@endif
15 changes: 12 additions & 3 deletions tests/Components/FathomTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@

Config::set('laravel-default.services.fathom.environments', ['testing']);

$siteId = 'XYZ';

$script = '<script src="https://cdn-eu.usefathom.com/script.js" data-site="'.$siteId.'" defer></script>';

$view = $this->blade(
'<x-default::fathom/>',
);

ray($view->__toString());
expect($view->__toString())->toContain(
'<script src="https://cdn-eu.usefathom.com/script.js" data-site="" defer></script>'
expect($view->__toString())->not()->toContain($script);

Config::set('laravel-default.services.fathom.site_id', $siteId);

$view = $this->blade(
'<x-default::fathom/>',
);

expect($view->__toString())->toContain($script);
})->group('components');
3 changes: 0 additions & 3 deletions tests/Components/FaviconsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
$view = $this->blade(
'<x-default::favicons/>',
);

ray($view->__toString());

expect($view->__toString())->toContain(
'<link rel="apple-touch-icon" sizes="57x57" href="http://localhost/favicons/apple-icon-57x57.png">',
'<link rel="apple-touch-icon" sizes="60x60" href="http://localhost/favicons/apple-icon-60x60.png">',
Expand Down

0 comments on commit cee413c

Please sign in to comment.