mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 08:30:02 +03:00
Mock Math.random()
This commit is contained in:
parent
a8876fb71a
commit
41a955eddf
|
@ -5,6 +5,18 @@ import { Form } from '../src';
|
||||||
import { schema, uiSchema, formData } from '../src/Form/schema';
|
import { schema, uiSchema, formData } from '../src/Form/schema';
|
||||||
|
|
||||||
describe('Form', function () {
|
describe('Form', function () {
|
||||||
|
let random: () => number;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
random = Math.random;
|
||||||
|
Math.random = jest.fn(() => 0.25546350798039463);
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(() => {
|
||||||
|
Math.random = random;
|
||||||
|
console.log(Math.random());
|
||||||
|
});
|
||||||
|
|
||||||
it('renders correctly', () => {
|
it('renders correctly', () => {
|
||||||
const { container } = render(
|
const { container } = render(
|
||||||
<Form formData={formData} schema={schema} uiSchema={uiSchema} />
|
<Form formData={formData} schema={schema} uiSchema={uiSchema} />
|
||||||
|
|
|
@ -618,7 +618,7 @@ exports[`Form renders with no button 1`] = `
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<input
|
<input
|
||||||
name="0.8152240754640543"
|
name="0.25546350798039463"
|
||||||
type="radio"
|
type="radio"
|
||||||
value="1"
|
value="1"
|
||||||
/>
|
/>
|
||||||
|
@ -632,7 +632,7 @@ exports[`Form renders with no button 1`] = `
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<input
|
<input
|
||||||
name="0.8152240754640543"
|
name="0.25546350798039463"
|
||||||
type="radio"
|
type="radio"
|
||||||
value="2"
|
value="2"
|
||||||
/>
|
/>
|
||||||
|
@ -646,7 +646,7 @@ exports[`Form renders with no button 1`] = `
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<input
|
<input
|
||||||
name="0.8152240754640543"
|
name="0.25546350798039463"
|
||||||
type="radio"
|
type="radio"
|
||||||
value="3"
|
value="3"
|
||||||
/>
|
/>
|
||||||
|
@ -960,7 +960,7 @@ exports[`Form renders with primary button 1`] = `
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<input
|
<input
|
||||||
name="0.6341426827216534"
|
name="0.25546350798039463"
|
||||||
type="radio"
|
type="radio"
|
||||||
value="1"
|
value="1"
|
||||||
/>
|
/>
|
||||||
|
@ -974,7 +974,7 @@ exports[`Form renders with primary button 1`] = `
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<input
|
<input
|
||||||
name="0.6341426827216534"
|
name="0.25546350798039463"
|
||||||
type="radio"
|
type="radio"
|
||||||
value="2"
|
value="2"
|
||||||
/>
|
/>
|
||||||
|
@ -988,7 +988,7 @@ exports[`Form renders with primary button 1`] = `
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<input
|
<input
|
||||||
name="0.6341426827216534"
|
name="0.25546350798039463"
|
||||||
type="radio"
|
type="radio"
|
||||||
value="3"
|
value="3"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user