From 483e6da55061315f32717631741dcb388b2c6245 Mon Sep 17 00:00:00 2001 From: Josh Johnson Date: Sun, 3 Nov 2019 18:03:23 +0000 Subject: [PATCH] Add tests --- src/scripts/choices.test.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/scripts/choices.test.js b/src/scripts/choices.test.js index 9409c63..06f4f96 100644 --- a/src/scripts/choices.test.js +++ b/src/scripts/choices.test.js @@ -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 = ` + + `; + + instance = new Choices('[data-choice]', { + renderSelectedChoices: 'test', + }); + + expect(instance.config.renderSelectedChoices).to.equal('auto'); + }); + }); }); });