@@ -96,43 +96,7 @@ describe("ChangeKdfComponent", () => {
9696
9797 mockConfigService . getFeatureFlag$ . mockReturnValue ( of ( false ) ) ;
9898
99- // Mock i18n service with switch statement for all keys
100- mockI18nService . t . mockImplementation ( ( key : string ) => {
101- switch ( key ) {
102- case "encKeySettings" :
103- return "Encryption Key Settings" ;
104- case "kdfSettingsChangeLogoutWarning" :
105- return "Proceeding will log you out of all active sessions. You will need to log back in and complete two-step login, if any. We recommend exporting your vault before changing your encryption settings to prevent data loss." ;
106- case "encryptionKeySettingsHowShouldWeEncryptYourData" :
107- return "How should we encrypt your data?" ;
108- case "encryptionKeySettingsIncreaseImproveSecurity" :
109- return "Increase the number of iterations to improve security at the cost of slower login times." ;
110- case "algorithm" :
111- return "Algorithm" ;
112- case "kdfIterations" :
113- return "KDF Iterations" ;
114- case "kdfIterationRecommends" :
115- return "Minimum 100,000 iterations recommended." ;
116- case "kdfMemory" :
117- return "Memory (MB)" ;
118- case "kdfParallelism" :
119- return "Parallelism" ;
120- case "updateEncryptionSettings" :
121- return "Update Encryption Settings" ;
122- case "encryptionKeySettingsAlgorithmPopoverTitle" :
123- return "Encryption Key Settings" ;
124- case "encryptionKeySettingsAlgorithmPopoverPBKDF2" :
125- return "PBKDF2 SHA-256 is the default algorithm and is supported by all Bitwarden applications." ;
126- case "encryptionKeySettingsAlgorithmPopoverArgon2Id" :
127- return "Argon2id is a newer algorithm that is more secure but may not be supported by older Bitwarden applications." ;
128- case "learnMoreAboutEncryptionAlgorithms" :
129- return "Learn more about encryption algorithms" ;
130- case "learnMore" :
131- return "Learn more" ;
132- default :
133- return key ;
134- }
135- } ) ;
99+ mockI18nService . t . mockImplementation ( ( key ) => `${ key } -used-i18n` ) ;
136100
137101 TestBed . configureTestingModule ( {
138102 declarations : [ ChangeKdfComponent ] ,
@@ -230,13 +194,13 @@ describe("ChangeKdfComponent", () => {
230194
231195 // Assert
232196 const calloutElement = fixture . debugElement . query ( ( el ) =>
233- el . nativeElement . textContent ?. includes ( "Proceeding will log you out " ) ,
197+ el . nativeElement . textContent ?. includes ( "kdfSettingsChangeLogoutWarning " ) ,
234198 ) ;
235199
236200 if ( showLogOutBanner ) {
237201 expect ( calloutElement ) . not . toBeNull ( ) ;
238202 expect ( calloutElement . nativeElement . textContent ) . toContain (
239- "Proceeding will log you out of all active sessions " ,
203+ "kdfSettingsChangeLogoutWarning-used-i18n " ,
240204 ) ;
241205 } else {
242206 expect ( calloutElement ) . toBeNull ( ) ;
0 commit comments