mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-10 18:29:03 +00:00
Replace manual mock with jest.mock
This commit is contained in:
@@ -23,9 +23,15 @@ import _FontScalingPanel from '../../../../src/components/views/settings/FontSca
|
|||||||
|
|
||||||
const FontScalingPanel = TestUtils.wrapInMatrixClientContext(_FontScalingPanel);
|
const FontScalingPanel = TestUtils.wrapInMatrixClientContext(_FontScalingPanel);
|
||||||
|
|
||||||
import * as randomstring from "matrix-js-sdk/src/randomstring";
|
// Fake random strings to give a predictable snapshot
|
||||||
// @ts-expect-error: override random function to make results predictable
|
jest.mock(
|
||||||
randomstring.randomString = () => "abdefghi";
|
'matrix-js-sdk/src/randomstring',
|
||||||
|
() => {
|
||||||
|
return {
|
||||||
|
randomString: () => "abdefghi",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
describe('FontScalingPanel', () => {
|
describe('FontScalingPanel', () => {
|
||||||
it('renders the font scaling UI', () => {
|
it('renders the font scaling UI', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user