diff options
Diffstat (limited to 'spec/frontend/default/components/helpers/versions_menu_helper.js')
-rw-r--r-- | spec/frontend/default/components/helpers/versions_menu_helper.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/frontend/default/components/helpers/versions_menu_helper.js b/spec/frontend/default/components/helpers/versions_menu_helper.js new file mode 100644 index 00000000..bdc1fa88 --- /dev/null +++ b/spec/frontend/default/components/helpers/versions_menu_helper.js @@ -0,0 +1,14 @@ +/** + * Creates a mock browser window object with a given path. + * @param {String} pathname + */ +export const setWindowPath = (pathname) => { + const location = { + ...window.location, + pathname, + }; + Object.defineProperty(window, 'location', { + writable: true, + value: location, + }); +}; |