1
- import { extractRecoveryCode , appPrefix , gen } from "../../../../helpers"
1
+ import { extractRecoveryCode , appPrefix , gen , email } from "../../../../helpers"
2
2
import { routes as react } from "../../../../helpers/react"
3
3
import { routes as express } from "../../../../helpers/express"
4
4
@@ -162,7 +162,7 @@ context("Account Recovery Errors", () => {
162
162
cy . get ( '[name="method"][value="code"]' ) . should ( "exist" )
163
163
} )
164
164
165
- it ( "invalid remote recovery email template" , ( ) => {
165
+ it ( "remote recovery email template (recovery_code_valid) " , ( ) => {
166
166
cy . remoteCourierRecoveryCodeTemplates ( )
167
167
const identity = gen . identityWithWebsite ( )
168
168
cy . registerApi ( identity )
@@ -175,9 +175,22 @@ context("Account Recovery Errors", () => {
175
175
)
176
176
177
177
cy . getMail ( ) . then ( ( mail ) => {
178
- expect ( mail . body ) . to . include (
179
- "this is a remote invalid recovery template" ,
180
- )
178
+ expect ( mail . body ) . to . include ( "recovery_code_valid REMOTE TEMPLATE" )
179
+ } )
180
+ } )
181
+
182
+ it ( "remote recovery email template (recovery_code_invalid)" , ( ) => {
183
+ cy . remoteCourierRecoveryCodeTemplates ( )
184
+ cy . visit ( recovery )
185
+ cy . get ( appPrefix ( app ) + "input[name='email']" ) . type ( email ( ) )
186
+ cy . get ( "button[value='code']" ) . click ( )
187
+ cy . get ( '[data-testid="ui/message/1060003"]' ) . should (
188
+ "have.text" ,
189
+ "An email containing a recovery code has been sent to the email address you provided." ,
190
+ )
191
+
192
+ cy . getMail ( ) . then ( ( mail ) => {
193
+ expect ( mail . body ) . to . include ( "recovery_code_invalid REMOTE TEMPLATE" )
181
194
} )
182
195
} )
183
196
} )
0 commit comments