@@ -4,6 +4,7 @@ import { NOTIFICATION_VERSIONS } from '$lib/constants/notification.constants';
44import * as notificationServices from '$lib/services/notification.services' ;
55import { hiddenMicroTransactionsResetStore } from '$lib/stores/settings.store' ;
66import { userProfileStore } from '$lib/stores/user-profile.store' ;
7+ import en from '$tests/mocks/i18n.mock' ;
78import { mockUserProfile , mockUserSettings } from '$tests/mocks/user-profile.mock' ;
89import { toNullable } from '@dfinity/utils' ;
910import { fireEvent , render } from '@testing-library/svelte' ;
@@ -50,15 +51,15 @@ describe('HiddenMicroTransactionsInfoBox', () => {
5051
5152 const { queryByRole } = render ( HiddenMicroTransactionsInfoBox ) ;
5253
53- expect ( queryByRole ( 'button' , { name : 'Close' } ) ) . toBeInTheDocument ( ) ;
54+ expect ( queryByRole ( 'button' , { name : en . core . text . close } ) ) . toBeInTheDocument ( ) ;
5455 } ) ;
5556
5657 it ( 'is hidden when the feature is off' , ( ) => {
5758 setUserProfile ( { hideMicroTransactions : false } ) ;
5859
5960 const { queryByRole } = render ( HiddenMicroTransactionsInfoBox ) ;
6061
61- expect ( queryByRole ( 'button' , { name : 'Close' } ) ) . not . toBeInTheDocument ( ) ;
62+ expect ( queryByRole ( 'button' , { name : en . core . text . close } ) ) . not . toBeInTheDocument ( ) ;
6263 } ) ;
6364
6465 it ( 'is hidden when the backend notification is dismissed and the reset flag is off' , ( ) => {
@@ -69,7 +70,7 @@ describe('HiddenMicroTransactionsInfoBox', () => {
6970
7071 const { queryByRole } = render ( HiddenMicroTransactionsInfoBox ) ;
7172
72- expect ( queryByRole ( 'button' , { name : 'Close' } ) ) . not . toBeInTheDocument ( ) ;
73+ expect ( queryByRole ( 'button' , { name : en . core . text . close } ) ) . not . toBeInTheDocument ( ) ;
7374 } ) ;
7475
7576 it ( 're-shows the info box when the reset flag is on, even if the backend notification is dismissed (OISY-2876)' , ( ) => {
@@ -84,7 +85,7 @@ describe('HiddenMicroTransactionsInfoBox', () => {
8485
8586 const { queryByRole } = render ( HiddenMicroTransactionsInfoBox ) ;
8687
87- expect ( queryByRole ( 'button' , { name : 'Close' } ) ) . toBeInTheDocument ( ) ;
88+ expect ( queryByRole ( 'button' , { name : en . core . text . close } ) ) . toBeInTheDocument ( ) ;
8889 } ) ;
8990
9091 it ( 'clears the reset flag and persists the backend dismissal when the user closes the box' , async ( ) => {
@@ -99,7 +100,7 @@ describe('HiddenMicroTransactionsInfoBox', () => {
99100
100101 const { getByRole } = render ( HiddenMicroTransactionsInfoBox ) ;
101102
102- await fireEvent . click ( getByRole ( 'button' , { name : 'Close' } ) ) ;
103+ await fireEvent . click ( getByRole ( 'button' , { name : en . core . text . close } ) ) ;
103104
104105 expect ( get ( hiddenMicroTransactionsResetStore ) . enabled ) . toBeFalsy ( ) ;
105106
0 commit comments