Skip to content

Commit 5137aa0

Browse files
committed
Add test for textContent for select option names
1 parent 7bf507e commit 5137aa0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/unit/dom/dom.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,14 @@ suite('DOM', function() {
808808
}
809809
});
810810

811+
test('should update select value when HTML special characters are in the name', function() {
812+
testElement = myp5.createSelect(true);
813+
testElement.option('&', 'foo');
814+
assert.equal(testElement.elt.options[0].value, 'foo');
815+
testElement.option('&', 'bar');
816+
assert.equal(testElement.elt.options[0].value, 'bar');
817+
});
818+
811819
test('calling selected(value) should updated selectedIndex', function() {
812820
testElement = myp5.createSelect(true);
813821
options = ['Sunday', 'Monday', 'Tuesday', 'Friday'];

0 commit comments

Comments
 (0)