import { email } from '../regex'

describe('email regex', () => {
  it('rejects wrong email', () => {
    const wrongEmail = 'i am not an email'.match(email)
    expect(wrongEmail).toBe(null)
  })
  it('parses simple emails', () => {
    const simpleEmail = 'tomi@cvetic.ch'.match(email)
    expect(simpleEmail).not.toBe(null)
    expect(simpleEmail && simpleEmail[0]).toBe('tomi@cvetic.ch')
  })
})
