File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
packages/react-dom/src/__tests__ Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -3971,6 +3971,34 @@ body {
3971
3971
) ;
3972
3972
} ) ;
3973
3973
3974
+ it ( 'does not include crossOrigin when keying image preloads' , async ( ) => {
3975
+ function App ( ) {
3976
+ return (
3977
+ < html >
3978
+ < body >
3979
+ < img src = "foo.png" crossOrigin = "" />
3980
+ < img src = "foo.png" crossOrigin = "anonymous" />
3981
+ </ body >
3982
+ </ html >
3983
+ ) ;
3984
+ }
3985
+
3986
+ await act ( ( ) => {
3987
+ renderToPipeableStream ( < App /> ) . pipe ( writable ) ;
3988
+ } ) ;
3989
+ expect ( getMeaningfulChildren ( document ) ) . toEqual (
3990
+ < html >
3991
+ < head >
3992
+ < link rel = "preload" as = "image" crossorigin = "" href = "foo.png" > </ link >
3993
+ </ head >
3994
+ < body >
3995
+ < img src = "foo.png" crossorigin = "" />
3996
+ < img src = "foo.png" crossorigin = "anonymous" />
3997
+ </ body >
3998
+ </ html > ,
3999
+ ) ;
4000
+ } ) ;
4001
+
3974
4002
it ( 'can emit preloads for non-lazy images that are rendered' , async ( ) => {
3975
4003
function App ( ) {
3976
4004
ReactDOM . preload ( 'script' , { as : 'script' } ) ;
You can’t perform that action at this time.
0 commit comments