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
4 changes: 2 additions & 2 deletions backend/src/api/controllers/result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export async function reportCompletedEventMismatch(
duration,
funboxes,
version,
data,
eventLog,
} = req.body;
// Logger.warning(
// `Completed event mismatch for uid ${uid}: ${notMatching.join(", ")}`,
Expand All @@ -220,7 +220,7 @@ export async function reportCompletedEventMismatch(
duration,
funboxes,
version,
data,
eventLog,
},
uid,
);
Expand Down
12 changes: 6 additions & 6 deletions frontend/__tests__/test/events/data.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ vi.mock("../../../src/ts/test/test-stats", () => ({
import {
logTestEvent,
getAllTestEvents,
getEventsPerWord,
cleanupData,
resetTestEvents,
__testing,
Expand All @@ -22,6 +21,7 @@ import type {
TimerEventData,
} from "../../../src/ts/test/events/types";
import { Keycode } from "../../../src/ts/constants/keys";
import { getEventsPerWord } from "../../../src/ts/test/events/helpers";

function keyDown(code: Keycode | "NoCode" = "KeyA"): KeydownEventData {
return { code };
Expand Down Expand Up @@ -251,7 +251,7 @@ describe("data.ts", () => {
logTestEvent("input", 1020, inputData({ wordIndex: 0, charIndex: 1 }));
logTestEvent("input", 1030, inputData({ wordIndex: 1, charIndex: 0 }));

const perWord = getEventsPerWord();
const perWord = getEventsPerWord(getAllTestEvents());
expect(perWord.get(0)).toHaveLength(2);
expect(perWord.get(1)).toHaveLength(1);
});
Expand All @@ -266,7 +266,7 @@ describe("data.ts", () => {
wordIndex: 0,
});

const perWord = getEventsPerWord();
const perWord = getEventsPerWord(getAllTestEvents());
expect(perWord.get(0)).toHaveLength(3);
});

Expand All @@ -277,23 +277,23 @@ describe("data.ts", () => {
inputType: "deleteContentBackward",
} as InputEventData);

const perWord = getEventsPerWord();
const perWord = getEventsPerWord(getAllTestEvents());
expect(perWord.get(0)).toHaveLength(1);
});

it("respects testMsLimit", () => {
logTestEvent("input", 1010, inputData({ wordIndex: 0, charIndex: 0 }));
logTestEvent("input", 1100, inputData({ wordIndex: 0, charIndex: 1 }));

const perWord = getEventsPerWord(undefined, 50);
const perWord = getEventsPerWord(getAllTestEvents(), undefined, 50);
expect(perWord.get(0)).toHaveLength(1);
});

it("respects startMs", () => {
logTestEvent("input", 1010, inputData({ wordIndex: 0, charIndex: 0 }));
logTestEvent("input", 1100, inputData({ wordIndex: 0, charIndex: 1 }));

const perWord = getEventsPerWord(50);
const perWord = getEventsPerWord(getAllTestEvents(), 50);
expect(perWord.get(0)).toHaveLength(1);
const first = perWord.get(0)?.[0];
expect(first?.type === "input" && first.data.charIndex).toBe(1);
Expand Down
Loading
Loading