Skip to content
Snippets Groups Projects
App.test.tsx 623 B
Newer Older
  • Learn to ignore specific revisions
  • import { render } from '@testing-library/react'
    
    Albin Henriksson's avatar
    Albin Henriksson committed
    import mockedAxios from 'axios'
    
    import React from 'react'
    
    import { act } from 'react-dom/test-utils'
    
    import { Provider } from 'react-redux'
    
    import App from './App'
    
    import store from './store'
    
    test('renders app', async () => {
      await act(async () => {
    
    Albin Henriksson's avatar
    Albin Henriksson committed
        const typeRes: any = {
          data: { component_types: [], view_types: [], question_types: [], media_types: [] },
        }
        ;(mockedAxios.get as jest.Mock).mockImplementation(() => {
          return Promise.resolve(typeRes)
        })
    
        render(
          <Provider store={store}>
            <App />
          </Provider>
        )
      })