Select Git revision
invisibleMaze.test.js
Forked from
SOFT Core / SOFT 260 / React Redux Starter Code
4 commits behind, 11 commits ahead of the upstream repository.
astumpff2 authored
invisibleMaze.test.js 1.14 KiB
import React from 'react';
import { render } from '@testing-library/react';
import '../../testing/mockRedux.js';
import {
selectStepOne,
selectStepTwo,
selectStepThree,
selectButtonOne,
selectButtonTwo,
selectButtonThree,
} from './invisibleMazeSlice.js';
import { InvisibleMaze } from './invisibleMaze.js';
jest.mock('./invisibleMazeSlice.js', () => ({
selectStepOne: jest.fn().mockName('selectStepOne'),
selectStepTwo: jest.fn().mockName('selectStepTwo'),
selectStepThree: jest.fn().mockName('selectStepThree'),
selectButtonOne: jest.fn().mockName('selectButtonOne'),
selectButtonTwo: jest.fn().mockName('selectButtonTwo'),
selectButtonThree: jest.fn().mockName('selectButtonThree'),
}));
describe('the maze', () => {
test('has a grid of 3x3 buttons', () => {
selectStepOne.mockReturnValue(9998);
selectStepTwo.mockReturnValue(9997);
selectStepThree.mockReturnValue(9999);
selectButtonOne.mockReturnValue(9998);
selectButtonTwo.mockReturnValue(9997);
selectButtonThree.mockReturnValue(9999);
const { container } = render(
<InvisibleMaze/>
);
expect(container).toMatchSnapshot();
});
});