Skip to content

Commit 960fc70

Browse files
committed
Add couple of tests for code-input after load
1 parent 4cadc45 commit 960fc70

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/tester.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ console.log("I've got another line!", 2 < 3, "should be true.");`);
217217
console.log("I've got another line!", 2 &lt; 3, "should be true.");
218218
`); // Extra newline so line numbers visible if enabled
219219

220+
const programmaticCodeInput = document.createElement("code-input");
221+
document.body.append(programmaticCodeInput);
222+
programmaticCodeInput.focus();
223+
document.execCommand("insertText", false, "Hello, World!");
224+
assertEqual("Core", "Programmatically-created element JS-accessible value", programmaticCodeInput.value, "Hello, World!");
225+
await waitAsync(50);
226+
assertEqual("Core", "Programmatically-created element rendered value", programmaticCodeInput.preElement.textContent, "Hello, World!\n");
227+
220228
// Event Listener Tests
221229
// Function type listeners
222230
let numTimesInputCalled = 0;

0 commit comments

Comments
 (0)