diff --git a/client/src/pages/admin/components/AddCompetition.test.tsx b/client/src/pages/admin/components/AddCompetition.test.tsx index 4a32971d43c5dc40284c49c18b90792d53057bd8..f9cdf24f8945176bb626f7d21d0c01d22d7fe2c9 100644 --- a/client/src/pages/admin/components/AddCompetition.test.tsx +++ b/client/src/pages/admin/components/AddCompetition.test.tsx @@ -1,17 +1,11 @@ -import { render, screen } from '@testing-library/react' -import { mount } from 'enzyme' +import { render } from '@testing-library/react' import React from 'react' import { Provider } from 'react-redux' import { BrowserRouter } from 'react-router-dom' -import configureMockStore from 'redux-mock-store' -import thunk from 'redux-thunk' import store from '../../../store' import AddCompetition from './AddCompetition' -const middlewares = [thunk] -const mockStore = configureMockStore(middlewares) - -fit('renders add competition', () => { +it('renders add competition', () => { render( <BrowserRouter> <Provider store={store}> @@ -20,32 +14,3 @@ fit('renders add competition', () => { </BrowserRouter> ) }) - -fit('it adds competitions', () => { - const cities = [ - { - id: 1, - name: 'Link\u00f6ping', - }, - { - id: 2, - name: 'Stockholm', - }, - ] - const store = mockStore({ cities }) - // console.log(store.getState()) - const wrapper = mount( - <Provider store={store}> - <AddCompetition /> - </Provider> - ) - const newCompetitionButton = wrapper.find('button') - newCompetitionButton.simulate('click') - const nameField = screen.getByRole('textbox') - // const nameField = textFields.children().first() - - // nameField.simulate('focus') - // nameField.simulate('change', { target: { value: 'Changed' } }) - console.log(nameField) - expect(wrapper.text().includes('2')).toBe(true) //TODO: check that SlideSettings exists -})