File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?php
22
33use Illuminate \Support \Facades \File ;
4-
54use function Pest \Laravel \get ;
65
76test ('default per page options are passed to the view ' , function () {
9695 $ response ->assertStatus (200 );
9796 $ response ->assertViewHas ('assetsPublished ' , true );
9897
99- // Should contain external file references
98+ // Should contain external stylesheet and script references
10099 $ content = $ response ->getContent ();
101- expect ($ content )->toContain ('href=" ' );
102- expect ($ content )->toContain ('src=" ' );
103- expect ($ content )->toContain (config ('log-viewer.assets_path ' ));
100+ expect ($ content )->toMatch ('/link href="[^"]*app\.css[^"]*" rel="stylesheet"/ ' );
101+ expect ($ content )->toMatch ('/script src="[^"]*app\.js[^"]*"/ ' );
104102});
105103
106104test ('assets_outdated is true when assets are published but stale ' , function () {
139137 expect ($ content )->not ->toContain ('<style> ' );
140138 // Should NOT contain base64 favicon
141139 expect ($ content )->not ->toContain ('data:image/png;base64, ' );
142- // Should contain external references
143- expect ($ content )->toContain (config ('log-viewer.assets_path ' ));
140+ // Should contain external stylesheet and script references
141+ expect ($ content )->toMatch ('/link href="[^"]*app\.css[^"]*" rel="stylesheet"/ ' );
142+ expect ($ content )->toMatch ('/script src="[^"]*app\.js[^"]*"/ ' );
144143});
You can’t perform that action at this time.
0 commit comments