UNPKG

yopmail-helper

Version:

yopmail helper. It will help you receive the mail content.

30 lines (26 loc) 1.05 kB
const {getInbox} = require('../../utils/inbox/inbox'); const {getMailDetails} = require('../../utils/mail-details/mail-details'); const {getLinkOfFirstMail} = require('../../utils/mail-details/mail-details-helper'); const {delay} = require('../../utils/delay/delays'); describe('mail details', () => { beforeEach(async () => { await delay(); }); it('Should able to get yopmail inbox details', async () => { const inbox = await getInbox('admin02'); if (inbox.length === 0) { console.warn('No mail found for admin02, skipping detail test.'); return; } const mailDetailsInfo = await getMailDetails(inbox[0].id, 'admin02'); expect(mailDetailsInfo).toHaveProperty('body'); expect(typeof mailDetailsInfo.body).toBe('string'); }); it('Should able to get link of inbox details', async () => { const links = await getLinkOfFirstMail('admin02'); if (links.length === 0) { console.warn('No link found for admin02, potentially no mail.'); } expect(Array.isArray(links)).toBe(true); }); });