lion/packages/validate/test/lion-validation-feedback.test.js
Thijs Louisse 6e81b55e3c feat(validate): new validation api, async validation and more
Co-authored-by: Thomas Allmer <Thomas.Allmer@ing.com>
2019-11-15 16:57:58 +01:00

18 lines
656 B
JavaScript

/* eslint-disable no-unused-vars, no-param-reassign */
import { fixture, html, expect } from '@open-wc/testing';
import '../lion-validation-feedback.js';
import { AlwaysInvalid } from '../test-helpers/helper-validators.js';
describe('lion-validation-feedback', () => {
it('renders a validation message', async () => {
const el = await fixture(
html`
<lion-validation-feedback></lion-validation-feedback>
`,
);
expect(el).shadowDom.to.equal('');
el.feedbackData = [{ message: 'hello', type: 'error', validator: new AlwaysInvalid() }];
await el.updateComplete;
expect(el).shadowDom.to.equal('hello');
});
});