@@ -1264,99 +1264,6 @@ describe(__filename, () => {
12641264 } ) ;
12651265 } ) ;
12661266
1267- describe ( 'version release notes' , ( ) => {
1268- const renderWithVersion = ( props = { } ) => {
1269- addon . current_version = { ...fakeVersion , ...props } ;
1270- renderWithAddon ( ) ;
1271- } ;
1272-
1273- it ( 'is hidden when an add-on has not loaded yet' , ( ) => {
1274- render ( ) ;
1275-
1276- expect (
1277- screen . queryByClassName ( 'AddonDescription-version-notes' ) ,
1278- ) . not . toBeInTheDocument ( ) ;
1279- } ) ;
1280-
1281- it ( 'is hidden when the add-on does not have a current version' , ( ) => {
1282- addon . current_version = null ;
1283- renderWithAddon ( ) ;
1284-
1285- expect (
1286- screen . queryByClassName ( 'AddonDescription-version-notes' ) ,
1287- ) . not . toBeInTheDocument ( ) ;
1288- } ) ;
1289-
1290- it ( 'is hidden when the current version does not have release notes' , ( ) => {
1291- renderWithVersion ( { release_notes : null } ) ;
1292-
1293- expect (
1294- screen . queryByClassName ( 'AddonDescription-version-notes' ) ,
1295- ) . not . toBeInTheDocument ( ) ;
1296- } ) ;
1297-
1298- it ( 'passes the expected contentId to ShowMoreCard' , async ( ) => {
1299- expect (
1300- await testContentId ( {
1301- addonProp : 'id' ,
1302- addonPropValue : addon . id + 1 ,
1303- cardClassName : 'AddonDescription-version-notes' ,
1304- } ) ,
1305- ) . toBeTruthy ( ) ;
1306- } ) ;
1307-
1308- it ( 'shows the version string' , ( ) => {
1309- const version = 'v1.4.5' ;
1310- renderWithVersion ( { version } ) ;
1311-
1312- expect ( screen . getByText ( 'Release notes for v1.4.5' ) ) . toBeInTheDocument ( ) ;
1313- } ) ;
1314-
1315- it ( 'shows the release notes' , ( ) => {
1316- const releaseNotes = 'Fixed some stuff' ;
1317- renderWithVersion ( {
1318- release_notes : createLocalizedString ( releaseNotes ) ,
1319- } ) ;
1320-
1321- expect ( screen . getByText ( releaseNotes ) ) . toBeInTheDocument ( ) ;
1322- } ) ;
1323-
1324- it ( 'allows some HTML tags' , ( ) => {
1325- const releaseNotes = '<b>lots</b> <i>of</i> <blink>bug fixes</blink>' ;
1326- renderWithVersion ( {
1327- release_notes : createLocalizedString ( releaseNotes ) ,
1328- } ) ;
1329-
1330- const notesCard = screen . getByClassName ( 'AddonDescription-version-notes' ) ;
1331-
1332- expect (
1333- screen . getByTextAcrossTags ( 'lots of bug fixes' ) ,
1334- ) . toBeInTheDocument ( ) ;
1335- expect ( within ( notesCard ) . getByTagName ( 'b' ) ) . toHaveTextContent ( 'lots' ) ;
1336- expect ( within ( notesCard ) . getByTagName ( 'i' ) ) . toHaveTextContent ( 'of' ) ;
1337- } ) ;
1338-
1339- it ( 'allows some ul-li tags' , ( ) => {
1340- const releaseNotes = '<b>The List</b><ul><li>one</li><li>two</li></ul>' ;
1341- renderWithVersion ( {
1342- release_notes : createLocalizedString ( releaseNotes ) ,
1343- } ) ;
1344-
1345- const notesCard = screen . getByClassName ( 'AddonDescription-version-notes' ) ;
1346-
1347- expect (
1348- within ( notesCard ) . getByTextAcrossTags ( 'The Listonetwo' ) ,
1349- ) . toBeInTheDocument ( ) ;
1350- expect ( within ( notesCard ) . getByRole ( 'list' ) ) . toBeInTheDocument ( ) ;
1351- expect ( within ( notesCard ) . getAllByRole ( 'listitem' ) [ 0 ] ) . toHaveTextContent (
1352- 'one' ,
1353- ) ;
1354- expect ( within ( notesCard ) . getAllByRole ( 'listitem' ) [ 1 ] ) . toHaveTextContent (
1355- 'two' ,
1356- ) ;
1357- } ) ;
1358- } ) ;
1359-
13601267 it ( 'renders the site identifier as a data attribute' , ( ) => {
13611268 renderWithAddon ( ) ;
13621269
0 commit comments