Attempt to fix failing test

pull/271/head
Candid Dauth 2024-04-26 05:32:45 +02:00
rodzic 47ddfa9f21
commit 469d2ee369
2 zmienionych plików z 9 dodań i 9 usunięć

Wyświetl plik

@ -11,13 +11,6 @@ test("Create line (Socket v2)", async () => {
const client1 = await openClient(undefined, SocketVersion.V2);
await createTemporaryMapV2(client1, {}, async (createMapData, mapData) => {
const client2 = await openClient(mapData.id, SocketVersion.V2);
const onLine1 = vi.fn();
client1.on("line", onLine1);
const onLine2 = vi.fn();
client2.on("line", onLine2);
const lineType = Object.values(client1.types).find((t) => t.type === "line")!;
const line = await client1.addLine({
@ -28,6 +21,13 @@ test("Create line (Socket v2)", async () => {
typeId: lineType.id
});
const client2 = await openClient(mapData.id, SocketVersion.V2);
const onLine1 = vi.fn();
client1.on("line", onLine1);
const onLine2 = vi.fn();
client2.on("line", onLine2);
const expectedLine = {
padId: mapData.id
};

Wyświetl plik

@ -58,8 +58,6 @@ test("Edit view (socket v2)", async () => {
const client1 = await openClient(undefined, SocketVersion.V2);
await createTemporaryMapV2(client1, {}, async (createMapData, mapData) => {
const client2 = await openClient(mapData.id, SocketVersion.V2);
const createdView = await client1.addView({
name: "Test view 1",
left: -10,
@ -70,6 +68,8 @@ test("Edit view (socket v2)", async () => {
layers: []
});
const client2 = await openClient(mapData.id, SocketVersion.V2);
const onView1 = vi.fn();
client1.on("view", onView1);
const onView2 = vi.fn();