Skip to content

Commit

Permalink
Fixed JS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Dec 3, 2024
1 parent 31d5281 commit f09d46f
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 16 deletions.
8 changes: 4 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@
"svelte-loader": "3.2.4",
"svelte-preprocess": "^6.0.3",
"svg-inline-loader": "^0.8.2",
"ts-jest": "^29.2.5",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "^5.7.2",
"vite": "^6.0.2",
"vite-plugin-svelte-svg-loader": "^1.0.1",
"vite-plugin-svelte-svgr": "^1.0.4",
"ts-jest": "^29.2.5"
"vite-plugin-svelte-svgr": "^1.0.4"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint .",
"preview": "vite preview",
"test": "jest src"
"test": "NODE_OPTIONS=--experimental-vm-modules CI=true jest src"
},
"dependencies": {
"@lottiefiles/svelte-lottie-player": "^0.3.1",
"dompurify": "^3.2.2",
"i18n-js": "^3.3.0",
"isomorphic-dompurify": "^2.18.0",
"isomorphic-fetch": "^3.0.0",
"js-cookie": "^3.0.5",
"pretty-print-json": "^3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion client/src/__tests__/utils/sanitize.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import DOMPurify from "dompurify";
import DOMPurify from "isomorphic-dompurify";

test("sanitize", () => {
const sanitized = decodeURIComponent(DOMPurify.sanitize("<form action='https://evil.com'><input type='text'></form>")) ;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Explanations.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import relaxGrey from "../icons/icons-studmob/cocktail-glass-grey.svg?raw";
import {offering} from "../stores/offering";
import hand from "../icons/icons-studmob/noun_Up hand drawn arrow_1563367.svg?raw";
import DOMPurify from "dompurify";
import DOMPurify from "isomorphic-dompurify";
const explanations = [
{name: "eduID", icon: eduIDGrey},
Expand Down
2 changes: 2 additions & 0 deletions client/src/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,5 @@ I18n.translations.en = {
},

};

export default I18n.translations.en;
2 changes: 2 additions & 0 deletions client/src/locale/nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,5 @@ I18n.translations.nl = {
}
},
};

export default I18n.translations.nl;
2 changes: 1 addition & 1 deletion client/src/routes/Offering.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import enrollWhite from "../icons/icons-studmob/official-building-3-white.svg?raw";
import eduID from "../icons/logo_eduID.svg?raw";
import balancer from "../icons/balancer.svg?raw";
import DOMPurify from "dompurify";
import DOMPurify from "isomorphic-dompurify";
import Cookies from "js-cookie";
import relax from "../icons/icons-studmob/cocktail-glass.svg?raw";
import highFive from "../icons/icons-studmob/undraw_High_five.svg?raw";
Expand Down
2 changes: 1 addition & 1 deletion client/src/routes/Person.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import Loading from "../components/Loading.svelte";
import {prettyPrintJson} from "pretty-print-json";
import "../stylesheets/pretty-print-json.min.css";
import DOMPurify from "dompurify";
import DOMPurify from "isomorphic-dompurify";
let loading = true;
let personHtml = {};
Expand Down
2 changes: 1 addition & 1 deletion client/src/utils/queryParameters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import DOMPurify from "dompurify";
import DOMPurify from "isomorphic-dompurify";

export function replaceQueryParameter(name, value, windowLocationSearch = window.location.search) {
const urlSearchParams = new URLSearchParams(windowLocationSearch);
Expand Down
Loading

0 comments on commit f09d46f

Please sign in to comment.