Skip to content

Commit 910af8b

Browse files
authored
Merge branch 'master' into feat/add-mechanical-soundpacks
2 parents d3bcb8a + ba8c39c commit 910af8b

84 files changed

Lines changed: 5513 additions & 5985 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/src/utils/result.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,14 @@ export function replaceLegacyValues(result: DBResult): DBResult {
122122
};
123123
}
124124

125+
if (typeof result.mode2 === "number") {
126+
result.mode2 = (result.mode2 as number).toString();
127+
}
128+
129+
//legacy value for english_1k
130+
if ((result.language as string) === "english_expanded") {
131+
result.language = "english_1k";
132+
}
133+
125134
return result;
126135
}

frontend/__tests__/components/core/Theme.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ describe("Theme component", () => {
8585
it("removes CSS when theme has no CSS", async () => {
8686
themeSignalMock.mockImplementation(() => ({ name: "light" }) as any);
8787
const { css } = renderComponent();
88-
expect(css.getAttribute("href")).toBe("");
88+
expect(css).not.toBeInTheDocument();
8989
});
9090

9191
it("removes CSS when theme is custom", async () => {
9292
themeSignalMock.mockImplementation(() => ({ name: "custom" }) as any);
9393
const { css } = renderComponent();
94-
expect(css.getAttribute("href")).toBe("");
94+
expect(css).not.toBeInTheDocument();
9595
});
9696

9797
it("handles CSS load error", () => {

frontend/__tests__/elements/account/result-filters.spec.ts renamed to frontend/__tests__/components/pages/account/utils.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { describe, it, expect } from "vitest";
2-
import defaultResultFilters from "../../../src/ts/constants/default-result-filters";
3-
import { mergeWithDefaultFilters } from "../../../src/ts/elements/account/result-filters";
2+
import defaultResultFilters from "../../../../src/ts/constants/default-result-filters";
3+
import { mergeWithDefaultFilters } from "../../../../src/ts/components/pages/account/utils";
44

5-
describe("result-filters.ts", () => {
5+
describe("utils.ts", () => {
66
describe("mergeWithDefaultFilters", () => {
77
it("should merge with default filters correctly", () => {
88
const tests = [

frontend/__tests__/controllers/preset-controller.spec.ts

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import * as ConfigUtils from "../../src/ts/config/utils";
99
import * as Persistence from "../../src/ts/config/persistence";
1010
import * as Notifications from "../../src/ts/states/notifications";
1111
import * as TestLogic from "../../src/ts/test/test-logic";
12-
import * as TagController from "../../src/ts/controllers/tag-controller";
12+
import * as Tags from "../../src/ts/collections/tags";
1313

1414
describe("PresetController", () => {
1515
describe("apply", () => {
@@ -34,12 +34,9 @@ describe("PresetController", () => {
3434
"showSuccessNotification",
3535
);
3636
const testRestartMock = vi.spyOn(TestLogic, "restart");
37-
const tagControllerClearMock = vi.spyOn(TagController, "clear");
38-
const tagControllerSetMock = vi.spyOn(TagController, "set");
39-
const tagControllerSaveActiveMock = vi.spyOn(
40-
TagController,
41-
"saveActiveToLocalStorage",
42-
);
37+
const tagsClearMock = vi.spyOn(Tags, "clearActiveTags");
38+
const tagsSetMock = vi.spyOn(Tags, "setTagActive");
39+
const tagsSaveActiveMock = vi.spyOn(Tags, "saveActiveToLocalStorage");
4340

4441
beforeEach(() => {
4542
[
@@ -49,9 +46,9 @@ describe("PresetController", () => {
4946
configGetConfigChangesMock,
5047
notificationAddMock,
5148
testRestartMock,
52-
tagControllerClearMock,
53-
tagControllerSetMock,
54-
tagControllerSaveActiveMock,
49+
tagsClearMock,
50+
tagsSetMock,
51+
tagsSaveActiveMock,
5552
].forEach((it) => it.mockClear());
5653

5754
configApplyMock.mockResolvedValue();
@@ -66,7 +63,7 @@ describe("PresetController", () => {
6663

6764
//THEN
6865
expect(configApplyMock).toHaveBeenCalledWith(preset.config);
69-
expect(tagControllerClearMock).toHaveBeenCalled();
66+
expect(tagsClearMock).toHaveBeenCalled();
7067
expect(testRestartMock).toHaveBeenCalled();
7168
expect(notificationAddMock).toHaveBeenCalledWith("Preset applied", {
7269
durationMs: 2000,
@@ -84,20 +81,10 @@ describe("PresetController", () => {
8481
await PresetController.apply(preset._id);
8582

8683
//THEN
87-
expect(tagControllerClearMock).toHaveBeenCalled();
88-
expect(tagControllerSetMock).toHaveBeenNthCalledWith(
89-
1,
90-
"tagOne",
91-
true,
92-
false,
93-
);
94-
expect(tagControllerSetMock).toHaveBeenNthCalledWith(
95-
2,
96-
"tagTwo",
97-
true,
98-
false,
99-
);
100-
expect(tagControllerSaveActiveMock).toHaveBeenCalled();
84+
expect(tagsClearMock).toHaveBeenCalled();
85+
expect(tagsSetMock).toHaveBeenNthCalledWith(1, "tagOne", true, false);
86+
expect(tagsSetMock).toHaveBeenNthCalledWith(2, "tagTwo", true, false);
87+
expect(tagsSaveActiveMock).toHaveBeenCalled();
10188
});
10289

10390
it("should ignore unknown preset", async () => {
@@ -145,20 +132,10 @@ describe("PresetController", () => {
145132
await PresetController.apply(preset._id);
146133

147134
//THEN
148-
expect(tagControllerClearMock).toHaveBeenCalled();
149-
expect(tagControllerSetMock).toHaveBeenNthCalledWith(
150-
1,
151-
"tagOne",
152-
true,
153-
false,
154-
);
155-
expect(tagControllerSetMock).toHaveBeenNthCalledWith(
156-
2,
157-
"tagTwo",
158-
true,
159-
false,
160-
);
161-
expect(tagControllerSaveActiveMock).toHaveBeenCalled();
135+
expect(tagsClearMock).toHaveBeenCalled();
136+
expect(tagsSetMock).toHaveBeenNthCalledWith(1, "tagOne", true, false);
137+
expect(tagsSetMock).toHaveBeenNthCalledWith(2, "tagTwo", true, false);
138+
expect(tagsSaveActiveMock).toHaveBeenCalled();
162139
});
163140

164141
const givenPreset = (partialPreset: Partial<Preset>): Preset => {

frontend/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
"@solid-primitives/transition-group": "1.1.2",
4040
"@solidjs/meta": "0.29.4",
4141
"@tanstack/pacer-lite": "0.2.1",
42-
"@tanstack/query-db-collection": "1.0.27",
43-
"@tanstack/solid-db": "0.2.10",
44-
"@tanstack/solid-devtools": "0.8.0",
45-
"@tanstack/solid-form": "1.28.4",
46-
"@tanstack/solid-hotkeys": "0.4.2",
47-
"@tanstack/solid-hotkeys-devtools": "0.4.3",
48-
"@tanstack/solid-query": "5.90.23",
49-
"@tanstack/solid-query-devtools": "5.91.3",
42+
"@tanstack/query-db-collection": "1.0.36",
43+
"@tanstack/solid-db": "0.2.19",
44+
"@tanstack/solid-devtools": "0.8.2",
45+
"@tanstack/solid-form": "1.29.1",
46+
"@tanstack/solid-hotkeys": "0.9.1",
47+
"@tanstack/solid-hotkeys-devtools": "0.6.6",
48+
"@tanstack/solid-query": "5.100.3",
49+
"@tanstack/solid-query-devtools": "5.100.3",
5050
"@tanstack/solid-table": "8.21.3",
5151
"@ts-rest/core": "3.52.1",
5252
"animejs": "4.2.2",
@@ -55,7 +55,7 @@
5555
"chart.js": "3.7.1",
5656
"chartjs-adapter-date-fns": "3.0.0",
5757
"chartjs-plugin-annotation": "2.2.1",
58-
"chartjs-plugin-trendline": "3.2.0",
58+
"chartjs-plugin-trendline": "3.2.4",
5959
"clsx": "2.1.1",
6060
"color-blend": "4.0.0",
6161
"damerau-levenshtein": "1.0.8",
@@ -82,7 +82,7 @@
8282
"@monkeytype/typescript-config": "workspace:*",
8383
"@solidjs/testing-library": "0.8.10",
8484
"@tailwindcss/vite": "4.2.1",
85-
"@tanstack/eslint-plugin-query": "5.91.4",
85+
"@tanstack/eslint-plugin-query": "5.100.3",
8686
"@testing-library/dom": "10.4.1",
8787
"@testing-library/jest-dom": "6.9.1",
8888
"@testing-library/user-event": "14.6.1",

0 commit comments

Comments
 (0)