mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-01-03 23:42:28 +03:00
Lexical: Finished conversion/update of test files
This commit is contained in:
@@ -717,3 +717,11 @@ export function html(
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
export function expectHtmlToBeEqual(expected: string, actual: string): void {
|
||||
expect(formatHtml(expected)).toBe(formatHtml(actual));
|
||||
}
|
||||
|
||||
function formatHtml(s: string): string {
|
||||
return s.replace(/>\s+</g, '><').replace(/\s*\n\s*/g, ' ').trim();
|
||||
}
|
||||
@@ -21,7 +21,6 @@ import {
|
||||
TextModeType,
|
||||
TextNode,
|
||||
} from 'lexical';
|
||||
import * as ReactTestUtils from 'lexical/shared/react-test-utils';
|
||||
|
||||
import {
|
||||
$createTestSegmentedNode,
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
import * as React from 'react';
|
||||
import * as ReactTestUtils from 'react-dom/test-utils';
|
||||
|
||||
/**
|
||||
* React 19 moved act from react-dom/test-utils to react
|
||||
* https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-react-dom-test-utils
|
||||
*/
|
||||
export const act =
|
||||
'act' in React
|
||||
? (React.act as typeof ReactTestUtils.act)
|
||||
: ReactTestUtils.act;
|
||||
Reference in New Issue
Block a user