From d6eb6cf1d024d49d1b15ae4387a95af2c10fe38d Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Mon, 26 Jun 2023 01:09:35 -0700 Subject: [PATCH] restore deleted example test --- test/unit/example.test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/unit/example.test.js b/test/unit/example.test.js index 94ad31b6d..c32a6ebfe 100644 --- a/test/unit/example.test.js +++ b/test/unit/example.test.js @@ -120,4 +120,19 @@ describe(`Example Tests`, function () { expect(greeting).toBe(`Good night, John!`); }); }); + + describe('Verify Special Changes Test Case', function () { + test('document.querySelector with id=pure number', () => { + const testText = 'This is a test'; + const testHTML = `

${testText}

`; + + // Inject HTML + document.body.innerHTML = testHTML; + expect(() => { + document.querySelector('#24'); + }).toThrow(DOMException); + + expect(document.querySelector("[id='24']").textContent).toBe(testText); + }); + }); });