- Delete outdated tests for `useSelfServeLogic` composable, step navigation, and validation related to the Self-Serve module. - These tests have been deprecated in favor of newer, streamlined testing strategies and refactored logic.
48 lines
885 B
JavaScript
48 lines
885 B
JavaScript
const storage = new Map();
|
|
|
|
const localStorageMock = {
|
|
getItem(key) {
|
|
return storage.has(key) ? storage.get(key) : null;
|
|
},
|
|
setItem(key, value) {
|
|
storage.set(key, String(value));
|
|
},
|
|
removeItem(key) {
|
|
storage.delete(key);
|
|
},
|
|
clear() {
|
|
storage.clear();
|
|
}
|
|
};
|
|
|
|
if (!globalThis.localStorage) {
|
|
globalThis.localStorage = localStorageMock;
|
|
}
|
|
|
|
if (!globalThis.window) {
|
|
globalThis.window = globalThis;
|
|
}
|
|
|
|
if (!globalThis.self) {
|
|
globalThis.self = globalThis;
|
|
}
|
|
|
|
if (!globalThis.window.alert) {
|
|
globalThis.window.alert = () => {};
|
|
}
|
|
|
|
if (!globalThis.window.open) {
|
|
globalThis.window.open = () => {};
|
|
}
|
|
|
|
if (!globalThis.window.matchMedia) {
|
|
globalThis.window.matchMedia = () => ({
|
|
matches: false,
|
|
addListener() {},
|
|
removeListener() {},
|
|
addEventListener() {},
|
|
removeEventListener() {},
|
|
dispatchEvent() { return false; }
|
|
});
|
|
}
|