mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 05:04:57 +08:00
Replace manual mock with jest.mock
This commit is contained in:
parent
d70a706c15
commit
2582f6df23
@ -23,9 +23,15 @@ import _FontScalingPanel from '../../../../src/components/views/settings/FontSca
|
||||
|
||||
const FontScalingPanel = TestUtils.wrapInMatrixClientContext(_FontScalingPanel);
|
||||
|
||||
import * as randomstring from "matrix-js-sdk/src/randomstring";
|
||||
// @ts-expect-error: override random function to make results predictable
|
||||
randomstring.randomString = () => "abdefghi";
|
||||
// Fake random strings to give a predictable snapshot
|
||||
jest.mock(
|
||||
'matrix-js-sdk/src/randomstring',
|
||||
() => {
|
||||
return {
|
||||
randomString: () => "abdefghi",
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
describe('FontScalingPanel', () => {
|
||||
it('renders the font scaling UI', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user