Skip to content

Commit 1250235

Browse files
Change inspector node test check over to be more explicit (#309)
1 parent 5e98a91 commit 1250235

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

integration-test/test-runtime-checks.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('Runtime checks: should allow element modification', () => {
4444
scriptElement.id = 'scripty'
4545
scriptElement.setAttribute('type', 'application/evilscript')
4646
document.body.appendChild(scriptElement)
47-
const hadInspectorNode = !!document.querySelector('ddg-runtime-checks')
47+
const hadInspectorNode = scriptElement === document.querySelector('ddg-runtime-checks')
4848
// Continue to modify the script element after it has been added to the DOM
4949
scriptElement.integrity = 'sha256-123'
5050
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
@@ -101,7 +101,7 @@ describe('Runtime checks: should allow element modification', () => {
101101
scriptElement.id = 'scripty2'
102102
scriptElement.setAttribute('type', 'application/javascript')
103103
document.body.appendChild(scriptElement)
104-
const hadInspectorNode = !!document.querySelector('ddg-runtime-checks')
104+
const hadInspectorNode = scriptElement === document.querySelector('ddg-runtime-checks')
105105
// Continue to modify the script element after it has been added to the DOM
106106
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
107107
scriptElement.madeUpProp = 'val'
@@ -174,7 +174,7 @@ describe('Runtime checks: should allow element modification', () => {
174174
document.body.appendChild(scriptElement)
175175
await Promise.all([promise, promise2])
176176

177-
const hadInspectorNode = !!document.querySelector('ddg-runtime-checks')
177+
const hadInspectorNode = scriptElement === document.querySelector('ddg-runtime-checks')
178178
// Continue to modify the script element after it has been added to the DOM
179179
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
180180
scriptElement.madeUpProp = 'val'
@@ -253,7 +253,7 @@ describe('Runtime checks: should allow element modification', () => {
253253
scriptElement.setAttribute('madeUpAttr1', '1')
254254
scriptElement.setAttribute('madeUpAttr2', '2')
255255
document.body.appendChild(scriptElement)
256-
const hadInspectorNode = !!document.querySelector('ddg-runtime-checks')
256+
const hadInspectorNode = scriptElement === document.querySelector('ddg-runtime-checks')
257257
// Continue to modify the script element after it has been added to the DOM
258258
// @ts-expect-error made up prop is unknown to TS
259259
scriptElement.madeUpProp1 = 'val'
@@ -412,7 +412,7 @@ describe('Runtime checks: should allow element modification', () => {
412412
scriptElement.id = 'scriptDocumentPrototype'
413413
scriptElement.setAttribute('type', 'application/javascript')
414414
document.body.appendChild(scriptElement)
415-
const hadInspectorNode = !!document.querySelector('ddg-runtime-checks')
415+
const hadInspectorNode = scriptElement === document.querySelector('ddg-runtime-checks')
416416
const instanceofResult = scriptElement instanceof HTMLScriptElement
417417
const scripty = document.querySelector('script#scriptDocumentPrototype')
418418

0 commit comments

Comments
 (0)