Skip to content

Commit e49ea01

Browse files
committed
Fix published mode tests for Windows path resolution
1 parent 433bb5a commit e49ea01

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

tests/Feature/IndexControllerTest.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22

33
use Illuminate\Support\Facades\File;
4-
54
use function Pest\Laravel\get;
65

76
test('default per page options are passed to the view', function () {
@@ -96,11 +95,10 @@
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

106104
test('assets_outdated is true when assets are published but stale', function () {
@@ -139,6 +137,7 @@
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
});

0 commit comments

Comments
 (0)