From 2a27e6e37a248a734f6f7c4bdcc84d8da126de1d Mon Sep 17 00:00:00 2001 From: Kevin Chappell Date: Wed, 6 Nov 2024 16:49:53 -0800 Subject: [PATCH] chore: revert line change --- src/lib/js/common/dom.js | 3 +-- src/lib/js/constants.js | 2 +- tools/test-setup.cjs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/js/common/dom.js b/src/lib/js/common/dom.js index 2ecb7c58..a255a123 100644 --- a/src/lib/js/common/dom.js +++ b/src/lib/js/common/dom.js @@ -278,8 +278,7 @@ class DOM { return this.iconSymbols } - const formeoSprite = document.getElementById(formeoSpriteId) - const iconSymbolNodes = formeoSprite.querySelectorAll('svg symbol') + const iconSymbolNodes = document.querySelectorAll(`#${formeoSpriteId} svg symbol`) const createSvgIconConfig = symbolId => ({ tag: 'svg', diff --git a/src/lib/js/constants.js b/src/lib/js/constants.js index c9704a3b..ac187a80 100644 --- a/src/lib/js/constants.js +++ b/src/lib/js/constants.js @@ -1,6 +1,6 @@ import pkg from '../../../package.json' with { type: 'json' } -const isProd = import.meta.env.PROD +const isProd = import.meta.env?.PROD const name = pkg.name const version = pkg.version diff --git a/tools/test-setup.cjs b/tools/test-setup.cjs index fa35502e..f1b2fb77 100644 --- a/tools/test-setup.cjs +++ b/tools/test-setup.cjs @@ -2,7 +2,7 @@ const { snapshot } = require('node:test') const { basename, join, dirname } = require('node:path') const { JSDOM } = require('jsdom') -const { window } = new JSDOM(`

Hello World

`) +const { window } = new JSDOM('

Hello World

') global.window = window global.document = window.document global.navigator = window.navigator