Skip to content

Commit

Permalink
feat: avoid collissions
Browse files Browse the repository at this point in the history
  • Loading branch information
arein committed Dec 31, 2023
1 parent e8b30a5 commit 6d60d0b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/laboratory/tests/email.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import { testMEmail } from './shared/fixtures/w3m-fixture'
import { DeviceRegistrationPage } from './shared/pages/DeviceRegistrationPage'
import { Email } from './shared/utils/email'

// Prevent collissions by using a semi-random reserved Mailsac email
const AVAILABLE_MAILSAC_ADDRESSES = 10

testMEmail.beforeEach(async ({ modalPage, context, modalValidator }) => {
// This is prone to collissions and will be improved later
const tempEmail = `web3modal@mailsac.com`
const tempEmail = `web3modal${Math.floor(
Math.random() * AVAILABLE_MAILSAC_ADDRESSES
)}@mailsac.com`
const email = new Email(process.env['MAILSAC_API_KEY']!)
await email.deleteAllMessages(tempEmail)
await modalPage.loginWithEmail(tempEmail)
Expand Down

0 comments on commit 6d60d0b

Please sign in to comment.