@@ -236,6 +236,43 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
236236 } )
237237 ) ;
238238
239+ test (
240+ '[email protected] - disallow password protected message terms' , 241+ testWithBrowser ( async ( t , browser ) => {
242+ 243+ const rules = getKeyManagerAutogenRules ( t . context . urls ! . port ! ) ;
244+ const disallowedPasswordMessageErrorText = 'Password-protected messages are disabled. Please check https://test.com' ;
245+
246+ t . context . mockApi ! . configProvider = new ConfigurationProvider ( {
247+ attester : {
248+ pubkeyLookup : { } ,
249+ } ,
250+ ekm : {
251+ keys : [ testConstants . existingPrv ] ,
252+ } ,
253+ fes : {
254+ clientConfiguration : {
255+ ...rules ,
256+ // eslint-disable-next-line @typescript-eslint/naming-convention
257+ disallow_password_messages_for_terms : [ 'forbidden' , 'test' ] ,
258+ // eslint-disable-next-line @typescript-eslint/naming-convention
259+ disallow_password_messages_error_text : disallowedPasswordMessageErrorText ,
260+ } ,
261+ } ,
262+ } ) ;
263+ const settingsPage = await BrowserRecipe . openSettingsLoginApprove ( t , browser , acct ) ;
264+ await SetupPageRecipe . autoSetupWithEKM ( settingsPage ) ;
265+ const composePage = await ComposePageRecipe . openStandalone ( t , browser , acct ) ;
266+ await ComposePageRecipe . fillMsg ( composePage , { to :
'[email protected] ' } , 'forbidden subject' ) ; 267+ await composePage . waitAndClick ( '@action-send' , { delay : 1 } ) ;
268+ await PageRecipe . checkModalLink ( composePage , 'error' , 'https://test.com' ) ;
269+ await PageRecipe . waitForModalAndRespond ( composePage , 'error' , {
270+ contentToCheck : disallowedPasswordMessageErrorText ,
271+ clickOn : 'confirm' ,
272+ } ) ;
273+ } )
274+ ) ;
275+
239276 test (
240277 'compose - signed with entered pass phrase + will remember pass phrase in session' ,
241278 testWithBrowser ( async ( t , browser ) => {
0 commit comments