@@ -77,7 +77,7 @@ public function testBasicRender()
77
77
78
78
$ this ->assertStringContainsString ('<script type="importmap"> ' , $ html );
79
79
// polyfill is rendered as a normal script tag
80
- $ this ->assertStringContainsString (' < script async src=" https://ga.jspm.io/npm:es-module-shims"></script> ' , $ html );
80
+ $ this ->assertStringContainsString (" script.setAttribute(' src', ' https://ga.jspm.io/npm:es-module-shims') " , $ html );
81
81
// and is hidden from the import map
82
82
$ this ->assertStringNotContainsString ('"es-module-shim" ' , $ html );
83
83
$ this ->assertStringContainsString ('import \'app \'; ' , $ html );
@@ -120,8 +120,8 @@ public function testDefaultPolyfillUsedIfNotInImportmap()
120
120
polyfillImportName: 'es-module-shims ' ,
121
121
);
122
122
$ html = $ renderer ->render (['app ' ]);
123
- $ this ->assertStringContainsString (' < script async src=" https://ga.jspm.io/npm:es-module-shims@' , $ html );
124
- $ this ->assertStringContainsString (' es-module-shims.js" crossorigin=" anonymous" integrity=" sha384-' , $ html );
123
+ $ this ->assertStringContainsString (" script.setAttribute(' src', ' https://ga.jspm.io/npm:es-module-shims@ " , $ html );
124
+ $ this ->assertStringContainsString (" script.setAttribute(' crossorigin', ' anonymous'); \n script.setAttribute(' integrity', ' sha384-" , $ html );
125
125
}
126
126
127
127
public function testCustomScriptAttributes ()
@@ -132,7 +132,12 @@ public function testCustomScriptAttributes()
132
132
]);
133
133
$ html = $ renderer ->render ([]);
134
134
$ this ->assertStringContainsString ('<script type="importmap" something data-turbo-track="reload"> ' , $ html );
135
- $ this ->assertStringContainsString ('<script async src="https://polyfillUrl.example" something data-turbo-track="reload"></script> ' , $ html );
135
+ $ this ->assertStringContainsString (<<<EOTXT
136
+ script.setAttribute('src', 'https://polyfillUrl.example');
137
+ script.setAttribute('async', 'async');
138
+ script.setAttribute('something', 'something');
139
+ script.setAttribute('data-turbo-track', 'reload');
140
+ EOTXT , $ html );
136
141
}
137
142
138
143
public function testWithEntrypoint ()
0 commit comments