Merge pull request #807 from ing-bank/chore/selectInReactTest
chore(select-rich): test React-like instantiation
This commit is contained in:
commit
ba8f0dd9a3
1 changed files with 20 additions and 0 deletions
|
|
@ -857,4 +857,24 @@ describe('lion-select-rich', () => {
|
||||||
expect(el.modelValue).to.equal('');
|
expect(el.modelValue).to.equal('');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Instantiation methods', () => {
|
||||||
|
it('can be instantiated via "document.createElement"', async () => {
|
||||||
|
let properlyInstantiated = false;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const el = document.createElement('lion-select-rich');
|
||||||
|
const optionsEl = document.createElement('lion-options');
|
||||||
|
optionsEl.slot = 'input';
|
||||||
|
const optionEl = document.createElement('lion-option');
|
||||||
|
optionsEl.appendChild(optionEl);
|
||||||
|
el.appendChild(optionsEl);
|
||||||
|
properlyInstantiated = true;
|
||||||
|
} catch (e) {
|
||||||
|
throw Error(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(properlyInstantiated).to.be.true;
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue