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