@@ -167,25 +167,28 @@ describe("media on custom hosts", () => {
167167 ] ) ;
168168 } ) ;
169169
170- it ( "keeps the caption of a media table instead of dropping it" , ( ) => {
171- const segments = splitPullRequestBody (
172- "<table>\n<caption>Before upgrading</caption>\n<tr><td>\n\nhttps://example.com/a.mp4\n\n</td></tr>\n</table>" ,
173- ) ;
174- expect ( segments . some ( ( segment ) => segment . kind === "table" ) ) . toBe ( false ) ;
175- expect ( segments ) . toContainEqual (
176- expect . objectContaining ( {
177- kind : "markdown" ,
178- text : expect . stringContaining ( "Before upgrading" ) ,
179- } ) ,
180- ) ;
181- expect ( segments ) . toContainEqual (
182- expect . objectContaining ( {
183- kind : "attachment" ,
184- url : "https://example.com/a.mp4" ,
185- media : "video" ,
186- } ) ,
187- ) ;
188- } ) ;
170+ it . each ( [ "<caption>Before upgrading</caption>" , "Before upgrading" , "<tr>Before upgrading</tr>" ] ) (
171+ "keeps table content outside cells: %s" ,
172+ ( extra ) => {
173+ const segments = splitPullRequestBody (
174+ `<table>\n${ extra } \n<tr><td>\n\nhttps://example.com/a.mp4\n\n</td></tr>\n</table>` ,
175+ ) ;
176+ expect ( segments . some ( ( segment ) => segment . kind === "table" ) ) . toBe ( false ) ;
177+ expect ( segments ) . toContainEqual (
178+ expect . objectContaining ( {
179+ kind : "markdown" ,
180+ text : expect . stringContaining ( "Before upgrading" ) ,
181+ } ) ,
182+ ) ;
183+ expect ( segments ) . toContainEqual (
184+ expect . objectContaining ( {
185+ kind : "attachment" ,
186+ url : "https://example.com/a.mp4" ,
187+ media : "video" ,
188+ } ) ,
189+ ) ;
190+ } ,
191+ ) ;
189192} ) ;
190193
191194describe ( "change request reference autolinks" , ( ) => {
0 commit comments