@@ -79,7 +79,9 @@ describe("parseMetadata", () => {
7979 ) ;
8080 expect ( screen . getByTestId ( "image" ) ) . toHaveAttribute (
8181 "src" ,
82- "https://example.com/image.png" ,
82+ expect . stringContaining (
83+ encodeURIComponent ( "https://example.com/image.png" ) ,
84+ ) ,
8385 ) ;
8486 expect ( screen . getByTestId ( "link" ) ) . toHaveAttribute (
8587 "href" ,
@@ -99,7 +101,9 @@ describe("parseMetadata", () => {
99101 expect ( screen . getByTestId ( "description" ) ) . toHaveTextContent ( metadata ) ; // fallback to raw string
100102 expect ( screen . getByTestId ( "image" ) ) . toHaveAttribute (
101103 "src" ,
102- "https://example.com/image.png" ,
104+ expect . stringContaining (
105+ encodeURIComponent ( "https://example.com/image.png" ) ,
106+ ) ,
103107 ) ;
104108 expect ( screen . getByTestId ( "link" ) ) . toHaveAttribute ( "href" , "" ) ;
105109 } ) ;
@@ -155,7 +159,9 @@ describe("parseMetadata", () => {
155159 ) ;
156160 expect ( screen . getByTestId ( "image" ) ) . toHaveAttribute (
157161 "src" ,
158- "https://example.com/complete.png" ,
162+ expect . stringContaining (
163+ encodeURIComponent ( "https://example.com/complete.png" ) ,
164+ ) ,
159165 ) ;
160166 expect ( screen . getByTestId ( "link" ) ) . toHaveAttribute (
161167 "href" ,
0 commit comments