Add the pulse script and the component for the public pages
PR CI / ledger (pull_request) Successful in 4s
PR CI / flow (pull_request) Successful in 4s
PR CI / ui (pull_request) Successful in 18s
PR CI / test (lowest) (pull_request) Successful in 39s
PR CI / security (pull_request) Successful in 49s
PR CI / test (stable) (pull_request) Successful in 51s
PR CI / pr-ci (pull_request) Successful in 2s
PR CI / release-automerge (pull_request) Successful in 3s
PR CI / ledger (pull_request) Successful in 4s
PR CI / flow (pull_request) Successful in 4s
PR CI / ui (pull_request) Successful in 18s
PR CI / test (lowest) (pull_request) Successful in 39s
PR CI / security (pull_request) Successful in 49s
PR CI / test (stable) (pull_request) Successful in 51s
PR CI / pr-ci (pull_request) Successful in 2s
PR CI / release-automerge (pull_request) Successful in 3s
This commit is contained in:
1 parent
1e002ed0c5
commit
5c0a94f167
9 files changed
+154
-1
No files matched your search
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use IriksIT\Manager\Tests\StatisticsOnTestCase;
|
||||
|
||||
uses(StatisticsOnTestCase::class);
|
||||
|
||||
it('serves the script for the public pages, without cookies or a session', function () {
|
||||
$response = $this->get('/pulse/pulse.js')->assertOk()->assertHeader('Content-Type', 'application/javascript');
|
||||
$script = $response->getFile()->getContent();
|
||||
|
||||
expect($script)->toContain('/view', '/leave', 'doNotTrack', 'globalPrivacyControl', "credentials: 'omit'")
|
||||
->and($response->headers->get('Set-Cookie'))->toBeNull();
|
||||
});
|
||||
|
||||
it('has a component that puts the script in a page', function () {
|
||||
$html = Blade::render('<x-manager::pulse />');
|
||||
|
||||
expect(trim($html))->toBe('<script src="/pulse/pulse.js" defer ></script>');
|
||||
expect(Blade::render('<x-manager::pulse :spa="true" />'))->toContain('data-spa');
|
||||
});
|
||||
Reference in new issue
Block a user