Skip to content

Commit

Permalink
restore deleted example test
Browse files Browse the repository at this point in the history
  • Loading branch information
trusktr committed Jun 26, 2023
1 parent 2d5e661 commit d6eb6cf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/unit/example.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `<div id=24><p>${testText}</p></div>`;

// Inject HTML
document.body.innerHTML = testHTML;
expect(() => {
document.querySelector('#24');
}).toThrow(DOMException);

expect(document.querySelector("[id='24']").textContent).toBe(testText);
});
});
});

0 comments on commit d6eb6cf

Please sign in to comment.