mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-12-14 19:42:14 +03:00
Lexical API: Started working on docs format and jest testing
This commit is contained in:
13
resources/js/wysiwyg/api/__tests__/api-test-utils.ts
Normal file
13
resources/js/wysiwyg/api/__tests__/api-test-utils.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import {createTestContext} from "lexical/__tests__/utils";
|
||||
import {EditorApi} from "../api";
|
||||
import {EditorUiContext} from "../../ui/framework/core";
|
||||
|
||||
|
||||
/**
|
||||
* Create an instance of the EditorApi and EditorUiContext.
|
||||
*/
|
||||
export function createEditorApiInstance(): { api: EditorApi; context: EditorUiContext } {
|
||||
const context = createTestContext();
|
||||
const api = new EditorApi(context);
|
||||
return {api, context};
|
||||
}
|
||||
Reference in New Issue
Block a user