@@ -1258,16 +1258,30 @@ describe('Maps Client JS', () => {
12581258 ] )
12591259 } )
12601260
1261+ test ( 'createFeaturesHTML - normal' , ( ) => {
1262+ const html = createFeaturesHTML ( features . slice ( 1 ) , 'test' , false , false )
1263+
1264+ expect ( html ) . toContain ( 'data-action="delete"' )
1265+ expect ( html ) . toContain ( 'data-action="edit"' )
1266+ expect ( html ) . not . toContain ( 'govuk-link--disabled' )
1267+ expect ( html ) . not . toContain ( 'data-action="focus"' )
1268+ } )
1269+
12611270 test ( 'createFeaturesHTML - readonly (for use in designer viewer)' , ( ) => {
12621271 const html = createFeaturesHTML ( features . slice ( 1 ) , 'test' , false , true )
12631272
1273+ expect ( html ) . not . toContain ( 'data-action="delete"' )
1274+ expect ( html ) . not . toContain ( 'data-action="edit"' )
12641275 expect ( html ) . toContain ( 'data-action="focus"' )
12651276 } )
12661277
1267- test ( 'createFeaturesHTML - exported for use in designer viewer - disabled' , ( ) => {
1278+ test ( 'createFeaturesHTML - disabled' , ( ) => {
12681279 const html = createFeaturesHTML ( features . slice ( 1 ) , 'test' , true , false )
12691280
12701281 expect ( html ) . toContain ( 'govuk-link--disabled' )
1282+ expect ( html ) . toContain ( 'data-action="delete"' )
1283+ expect ( html ) . toContain ( 'data-action="edit"' )
1284+ expect ( html ) . not . toContain ( 'data-action="focus"' )
12711285 } )
12721286 } )
12731287 } )
0 commit comments