mirror of
https://github.com/jlengrand/open-wc.git
synced 2026-03-10 08:31:19 +00:00
29 lines
868 B
JavaScript
29 lines
868 B
JavaScript
/* eslint-disable no-unused-expressions */
|
|
import { html, fixture, litFixture, expect } from '../../index.js';
|
|
|
|
import '../src/get-result.js';
|
|
|
|
describe('True Checking', () => {
|
|
it('is false by default', async () => {
|
|
const el = await fixture('<get-result></get-result>');
|
|
expect(el.success).to.be.false;
|
|
});
|
|
|
|
it('false values will have a light-dom of <p>NOPE</p>', async () => {
|
|
const el = await fixture('<get-result></get-result>');
|
|
expect(el).dom.to.equal('<get-result><p>NOPE</p></get-result>');
|
|
});
|
|
|
|
it('true values will have a light-dom of <p>YEAH</p>', async () => {
|
|
const foo = 1;
|
|
const el = await litFixture(
|
|
html`
|
|
<get-result .success=${foo === 1}></get-result>
|
|
`,
|
|
);
|
|
// @ts-ignore
|
|
expect(el.success).to.be.true;
|
|
expect(el).dom.to.equal('<get-result><p>YEAH</p></get-result>');
|
|
});
|
|
});
|