mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-05 12:07:10 +00:00
fix failing unit test of block editor in main (#20214)
This commit is contained in:
parent
f6aa883605
commit
e76e285cd3
@ -13,7 +13,6 @@
|
||||
import { EditorOptions } from '@tiptap/core';
|
||||
import { Editor } from '@tiptap/react';
|
||||
import { DependencyList, useEffect, useRef, useState } from 'react';
|
||||
import { extensions } from '../Extensions';
|
||||
|
||||
function useForceUpdate() {
|
||||
const [, setValue] = useState(0);
|
||||
@ -120,7 +119,6 @@ export const useCustomEditor = (
|
||||
|
||||
const instance = new Editor({
|
||||
...options,
|
||||
extensions: [...extensions],
|
||||
});
|
||||
|
||||
setEditor(instance);
|
||||
|
||||
@ -26,6 +26,9 @@ jest.mock('../../common/NextPrevious/NextPrevious', () => {
|
||||
</div>
|
||||
));
|
||||
});
|
||||
jest.mock('../../common/RichTextEditor/RichTextEditorPreviewerV1', () =>
|
||||
jest.fn().mockImplementation(({ markdown }) => <div>{markdown}</div>)
|
||||
);
|
||||
|
||||
const mockChildrenList = [
|
||||
{
|
||||
|
||||
@ -41,6 +41,10 @@ jest.mock('react-router-dom', () => ({
|
||||
})),
|
||||
}));
|
||||
|
||||
jest.mock('../../../common/RichTextEditor/RichTextEditorPreviewerV1', () =>
|
||||
jest.fn().mockImplementation(({ markdown }) => <div>{markdown}</div>)
|
||||
);
|
||||
|
||||
describe('PersonaDetailsCard Component', () => {
|
||||
it('should render persona details card', async () => {
|
||||
await act(async () => {
|
||||
|
||||
@ -23,6 +23,10 @@ const props = {
|
||||
showDescription: true,
|
||||
};
|
||||
|
||||
jest.mock('../../../common/RichTextEditor/RichTextEditorPreviewerV1', () =>
|
||||
jest.fn().mockImplementation(({ markdown }) => <div>{markdown}</div>)
|
||||
);
|
||||
|
||||
describe('ApplicationCard', () => {
|
||||
beforeEach(() => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
@ -40,6 +40,10 @@ jest.mock('../SuggestionsProvider/SuggestionsProvider', () => ({
|
||||
default: 'SuggestionsProvider',
|
||||
}));
|
||||
|
||||
jest.mock('../../common/RichTextEditor/RichTextEditorPreviewerV1', () =>
|
||||
jest.fn().mockImplementation(({ markdown }) => <div>{markdown}</div>)
|
||||
);
|
||||
|
||||
describe('SuggestionsAlert', () => {
|
||||
beforeEach(() => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user