Add tests

This commit is contained in:
Josh Johnson 2019-11-03 18:03:23 +00:00
parent 688ad3f534
commit 483e6da550

View file

@ -64,7 +64,7 @@ describe('choices', () => {
});
});
describe('passing the searchEnabled config option as false', () => {
describe('passing the searchEnabled config option with a value of false', () => {
describe('passing a select-multiple element', () => {
it('sets searchEnabled to true', () => {
document.body.innerHTML = `
@ -79,6 +79,20 @@ describe('choices', () => {
});
});
});
describe('passing the renderSelectedChoices config option with an unexpected value', () => {
it('sets renderSelectedChoices to "auto"', () => {
document.body.innerHTML = `
<select data-choice multiple></select>
`;
instance = new Choices('[data-choice]', {
renderSelectedChoices: 'test',
});
expect(instance.config.renderSelectedChoices).to.equal('auto');
});
});
});
});