From 06f1d16ca11301472b18043e485cd288a1045ced Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Wed, 14 Dec 2022 22:59:17 +0100 Subject: [PATCH] fix: coherce undefined `', function() { }); + describe('should select', function() { + + const getOptions = () => [ + { + label: 'A', + value: 'A' + }, + { + label: 'B', + value: 'B' + } + ]; + + + it('none (undefined value)', function() { + + // when + const result = createSelect({ container, getOptions, getValue: () => undefined }); + + const selectInput = domQuery('.bio-properties-panel-input', result.container); + + // then + expect(selectInput.value).to.equal(''); + }); + + + it('active entry', function() { + + // when + const result = createSelect({ container, getOptions, getValue: () => 'A' }); + + const selectInput = domQuery('.bio-properties-panel-input', result.container); + + const optionA = domQuery('option[value="A"]', selectInput); + + // then + expect(selectInput.value).to.equal('A'); + expect(optionA.selected).to.be.true; + }); + + }); + + it('should render disabled', function() { // given