@@ -218,14 +218,6 @@ test.describe('<mapml-viewer> localization tests', () => {
218218 } ) ;
219219
220220 test ( 'Hover messages for location tracking matches the locale key' , async ( ) => {
221- const buttonNames = [
222- 'btnLocTrackOn' ,
223- 'btnMyLocTrackOn' ,
224- 'btnLocTrackOff' ,
225- 'btnLocTrackLastKnown' ,
226- 'btnMyLastKnownLocTrackOn'
227- ] ;
228-
229221 for ( const [ language , locale ] of locales ) {
230222 // select the current map
231223 const map = await page . getByTestId ( language ) ;
@@ -286,20 +278,37 @@ test.describe('<mapml-viewer> localization tests', () => {
286278 } ) ;
287279
288280 test ( 'Map feature options matches the locale key' , async ( ) => {
289- // hover over map feature, controls after clicking on the feature
290- const buttonNames = [ ] ;
281+ const buttonNames = [
282+ 'kbdFocusMap' ,
283+ 'kbdPrevFeature' ,
284+ 'kbdNextFeature' ,
285+ 'kbdFocusControls'
286+ ] ;
287+
288+ // click all feature buttons
289+ const features = await page . getByTestId ( 'map-feature' ) ;
290+ const count = await features . count ( ) ;
291+ for ( let i = 0 ; i < count ; i ++ ) {
292+ await page . waitForTimeout ( 500 ) ;
293+ await features . nth ( i ) . evaluate ( ( node ) => node . click ( ) ) ;
294+ }
291295
292296 for ( const [ language , locale ] of locales ) {
293297 // select the current map
294298 const map = await page . getByTestId ( language ) ;
295299
296- // where do we access these?
300+ // test focus buttons (for map features)
301+ const focusButtons = await map . locator ( '.mapml-focus-buttons button' ) ;
302+ const buttonsCount = await focusButtons . count ( ) ;
303+ for ( let i = 0 ; i < buttonsCount ; i ++ ) {
304+ const text = await focusButtons . nth ( i ) . getAttribute ( 'title' ) ;
305+ expect ( text ) . toBeTruthy ( ) ;
306+ expect ( text . endsWith ( locale [ buttonNames [ i ] ] ) ) . toBe ( true ) ;
307+ }
297308 }
298309 } ) ;
299310
300- test ( 'Keyboard feature messages matches the locale key' , async ( ) => {
301- // in the attribution button, check that the keyboard feature messages
302- // are translated
311+ test ( 'Keyboard feature messages in the attribution button matches the locale key' , async ( ) => {
303312 const dialogBolded = [ 'kbdShortcuts' , 'kbdMovement' , 'kbdFeature' ] ;
304313
305314 const dialogListItems = [
0 commit comments