Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
[![Firebase](https://img.shields.io/badge/firebase-ffca28?style=for-the-badge&logo=firebase&logoColor=black)](https://firebase.google.com/)
[![Fontawesome](https://img.shields.io/badge/fontawesome-538DD7?style=for-the-badge&logo=fontawesome&logoColor=white)](https://fontawesome.com/)
[![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?style=for-the-badge&logo=html5&logoColor=white)](https://developer.mozilla.org/en-US/docs/Web/HTML)
[![JQuery](https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge&logo=jquery&logoColor=white)](https://jquery.com/)
[![MongoDB](https://img.shields.io/badge/-MongoDB-13aa52?style=for-the-badge&logo=mongodb&logoColor=white)](https://www.mongodb.com/)
[![OXLint](https://img.shields.io/badge/%E2%9A%93%20oxlint-2b3c5a?style=for-the-badge&logoColor=white)](https://oxc.rs/docs/guide/usage/linter.html)
[![PNPM](https://img.shields.io/badge/pnpm-F69220?style=for-the-badge&logo=pnpm&logoColor=white)](https://pnpm.io/)
Expand Down
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"@vitest/coverage-v8": "4.0.15",
"concurrently": "8.2.2",
"openapi3-ts": "2.0.2",
"oxlint": "1.36.0",
"oxlint-tsgolint": "0.10.0",
"oxlint": "1.38.0",
"oxlint-tsgolint": "0.10.1",
"readline-sync": "1.4.10",
"supertest": "7.1.4",
"testcontainers": "11.10.0",
Expand Down
14 changes: 9 additions & 5 deletions frontend/__tests__/setup-tests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { vi } from "vitest";
import $ from "jquery";
import { ElementWithUtils } from "../src/ts/utils/dom";
import { ElementsWithUtils, ElementWithUtils } from "../src/ts/utils/dom";

//@ts-expect-error add to global
global["$"] = $;
Expand All @@ -20,7 +20,7 @@ vi.mock("../src/ts/firebase", () => ({
isAuthenticated: () => false,
}));

vi.mock("../src/ts/utils/dom", () => {
vi.mock("../src/ts/utils/dom", async (importOriginal) => {
const createMockElement = (): ElementWithUtils => {
return {
disable: vi.fn().mockReturnThis(),
Expand All @@ -45,9 +45,9 @@ vi.mock("../src/ts/utils/dom", () => {
setStyle: vi.fn().mockReturnThis(),
getStyle: vi.fn().mockReturnValue({}),
isFocused: vi.fn().mockReturnValue(false),
qs: vi.fn().mockReturnValue(null),
qs: vi.fn().mockImplementation(() => createMockElement()),
qsr: vi.fn().mockImplementation(() => createMockElement()),
qsa: vi.fn().mockReturnValue([]),
qsa: vi.fn().mockImplementation(() => new ElementsWithUtils()),
empty: vi.fn().mockReturnThis(),
appendHtml: vi.fn().mockReturnThis(),
append: vi.fn().mockReturnThis(),
Expand All @@ -71,10 +71,14 @@ vi.mock("../src/ts/utils/dom", () => {
};
};

const actual = await importOriginal();

return {
//@ts-expect-error - mocking private method
...actual,
qsr: vi.fn().mockImplementation(() => createMockElement()),
qs: vi.fn().mockImplementation(() => createMockElement()),
qsa: vi.fn().mockReturnValue([]),
qsa: vi.fn().mockImplementation(() => new ElementsWithUtils()),
};
});

Expand Down
5 changes: 5 additions & 0 deletions frontend/__tests__/test/british-english.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,10 @@ describe("british-english", () => {
await expect(replace("'hello'", "")).resolves.toEqual("'hello'");
await expect(replace("test", "")).resolves.toEqual("test");
});

it("ignores prototype-related property names (e.g. constructor, __proto__)", async () => {
await expect(replace("constructor", "")).resolves.toEqual("constructor");
await expect(replace("__proto__", "")).resolves.toEqual("__proto__");
});
});
});
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
"madge": "8.0.0",
"magic-string": "0.30.17",
"normalize.css": "8.0.1",
"oxlint": "1.36.0",
"oxlint-tsgolint": "0.10.0",
"oxlint": "1.38.0",
"oxlint-tsgolint": "0.10.1",
"postcss": "8.4.31",
"sass": "1.70.0",
"subset-font": "2.3.0",
Expand Down
Loading
Loading