Move more element-web tests over to vitest (#33845)

* Move more element-web tests over to vitest

Switches default env to happy-dom as SdkConfig needs a DOM and is part of the setupTests given a lot of code relies on it

* Restore jest variant of editor mock file for tests not yet moved over

* Migrate batch of tests tro vitest

* Iterate

* Migrate another test

* Simplify

* Iterate

* Iterate

* Fix lockfile

* Deduplicate

* Iterate
This commit is contained in:
Michael Telatynski
2026-07-06 17:42:24 +00:00
committed by GitHub
parent 3da74a98e3
commit 08419cf0cf
20 changed files with 223 additions and 124 deletions
+3 -2
View File
@@ -13,6 +13,7 @@ import type AutocompleteWrapperModel from "../../../src/editor/autocomplete";
import { type Caret } from "../../../src/editor/caret";
import { type PillPart, type Part, PartCreator } from "../../../src/editor/parts";
import DocumentPosition from "../../../src/editor/position";
import { vi } from "../../setup/adapter.ts";
export class MockAutoComplete {
public _updateCallback;
@@ -68,8 +69,8 @@ export function createPartCreator(completions: PillPart[] = []) {
};
const room = new MockRoom() as unknown as Room;
const client = {
getRooms: jest.fn().mockReturnValue([]),
getRoom: jest.fn().mockReturnValue(null),
getRooms: vi.fn().mockReturnValue([]),
getRoom: vi.fn().mockReturnValue(null),
} as unknown as MatrixClient;
return new PartCreator(room, client, autoCompleteCreator);
}