lion/packages/input-email/test/lion-input-email.test.js
Thomas Allmer 396deb2e3b feat: finalize validation and adopt it everywhere
Co-authored-by: Alex Ghiu <alex.ghiu@ing.com>
Co-authored-by: Gerjan van Geest <Gerjan.van.Geest@ing.com>
Co-authored-by: Thijs Louisse <Thijs.Louisse@ing.com>
Co-authored-by: Joren Broekema <joren.broekema@ing.com>
Co-authored-by: Erik Kroes <erik.kroes@ing.com>
2019-11-18 15:30:08 +01:00

18 lines
684 B
JavaScript

import { expect, fixture } from '@open-wc/testing';
import '../lion-input-email.js';
describe('<lion-input-email>', () => {
it('has a type = text', async () => {
const el = await fixture(`<lion-input-email></lion-input-email>`);
expect(el._inputNode.type).to.equal('text');
});
it('has validator "IsEmail" applied by default', async () => {
// More elaborate tests can be found in lion-validate/test/StringValidators.test.js
const el = await fixture(`<lion-input-email></lion-input-email>`);
el.modelValue = 'foo@bar@example.com';
expect(el.hasFeedbackFor).to.deep.equal(['error']);
expect(el.validationStates.error.IsEmail).to.be.true;
});
});