Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | 12x 12x 149x 16x 12x 15x 12x | // Accounts created by the Playwright e2e suite. pre-signup.js auto-confirms
// them, and delete-account.js purges their credits/usage history on deletion
// (real users keep it as an accounting trail). Their mail is received into the
// e2e mailbox bucket (infrastructure/lib/e2e-mailbox.ts) on e2e.browsway.com.
const E2E_TEST_EMAIL_PATTERN = /^e2e-test-.+@e2e\.browsway\.com$/
// e2e accounts whose test goes through the real signup confirmation, reading
// the code Cognito emails them (flows-ui e2e `confirmByEmail` users), so
// pre-signup.js must leave them unconfirmed.
const E2E_CONFIRM_BY_EMAIL_PREFIX = 'e2e-test-confirm-'
/**
* @param {unknown} email
* @returns {boolean}
*/
function isE2eTestEmail(email) {
return typeof email === 'string' && E2E_TEST_EMAIL_PATTERN.test(email)
}
/**
* Whether pre-signup should confirm this account without the emailed code.
* @param {unknown} email
* @returns {boolean}
*/
function isE2eAutoConfirmEmail(email) {
return isE2eTestEmail(email) && !email.startsWith(E2E_CONFIRM_BY_EMAIL_PREFIX)
}
// The Playwright helpers that post a comment (postComment, replyToComment,
// commentAsStranger — see flows-ui/e2e/helpers.ts and moderation.spec.ts)
// prepend this to every comment body. It lets the moderation review queue
// (subjects/itemComment.js's isVisibleToReviewer) keep e2e test content and
// real content apart, on a shared dev deployment used for both at once: a
// test reviewer never has to sit behind someone's real pending comment to
// reach the one their test just posted, and a real reviewer never gets a
// leftover test comment offered to them either.
const E2E_TEST_COMMENT_PREFIX = '[e2e] '
/**
* @param {unknown} body
* @returns {boolean}
*/
function isE2eTestComment(body) {
return typeof body === 'string' && body.startsWith(E2E_TEST_COMMENT_PREFIX)
}
module.exports = {
E2E_TEST_EMAIL_PATTERN,
E2E_CONFIRM_BY_EMAIL_PREFIX,
isE2eTestEmail,
isE2eAutoConfirmEmail,
E2E_TEST_COMMENT_PREFIX,
isE2eTestComment
}
|