fix: do not check for browser extension in mobile app (#57470)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Sem Bauke
2024-12-12 10:12:45 +01:00
committed by GitHub
parent cd6a5f82b7
commit 2d2452eb83
3 changed files with 11 additions and 6 deletions

View File

@@ -49,9 +49,11 @@ assert(document.querySelector('h1').innerText.toLowerCase() === 'catphotoapp');
You appear to be using a browser extension that is modifying the page. Be sure to turn off all browser extensions.
```js
assert.isAtMost(document.querySelectorAll('script').length, 2);
assert.equal(document.querySelectorAll('style').length, 1);
assert.equal(document.querySelectorAll('link').length, 0);
if(__checkForBrowserExtensions){
assert.isAtMost(document.querySelectorAll('script').length, 2);
assert.equal(document.querySelectorAll('style').length, 1);
assert.equal(document.querySelectorAll('link').length, 0);
}
```
# --seed--

View File

@@ -50,9 +50,11 @@ assert.equal(document.querySelector('h1').innerText.toLowerCase(), 'catphotoapp'
You appear to be using a browser extension that is modifying the page. Be sure to turn off all browser extensions.
```js
assert.isAtMost(document.querySelectorAll('script').length, 2);
assert.equal(document.querySelectorAll('style').length, 1);
assert.equal(document.querySelectorAll('link').length, 0);
if(__checkForBrowserExtensions){
assert.isAtMost(document.querySelectorAll('script').length, 2);
assert.equal(document.querySelectorAll('style').length, 1);
assert.equal(document.querySelectorAll('link').length, 0);
}
```
# --seed--

View File

@@ -61,6 +61,7 @@ async function initTestFrame(e: InitTestFrameArg = { code: {} }) {
const { default: chai } = await import(/* webpackChunkName: "chai" */ 'chai');
const assert = chai.assert;
const __helpers = helpers;
const __checkForBrowserExtensions = true;
/* eslint-enable @typescript-eslint/no-unused-vars */
let Enzyme;