Skip to content
Snippets Groups Projects
Select Git revision
  • 2ebbef94361a52657928ffdc5829dad91cc8bbca
  • main default protected
2 results

app.test.js

Blame
  • app.test.js 667 B
    import { render } from '@testing-library/react';
    import './testing/mockRedux.js';
    import { MemoryRouter as Router } from 'react-router-dom';
    
    import { App } from './app.js';
    
    import {
      selectValue,
    } from './features/counter/counterSlice.js';
    jest.mock('./features/counter/counterSlice.js', () => ({
      selectValue: jest.fn().mockName('selectValue'),
    }));
    
    describe('the app', () => {
      test('has one labeled button that displays the value from the store', () => {
        selectValue.mockReturnValue(9999);
        const { container } = render(
          <Router initialEntries={['/']}>
            <App />
          </Router>,
        );
        expect(container).toMatchSnapshot();
      });
    });