Skip to content

Commit

Permalink
Merge cf7489e into 640935d
Browse files Browse the repository at this point in the history
  • Loading branch information
julienben committed Apr 1, 2019
2 parents 640935d + cf7489e commit ea14356
Show file tree
Hide file tree
Showing 51 changed files with 55 additions and 168 deletions.
4 changes: 1 addition & 3 deletions app/components/A/tests/index.test.js
Expand Up @@ -3,7 +3,7 @@
*/

import React from 'react';
import { render, cleanup } from 'react-testing-library';
import { render } from 'react-testing-library';

import A from '../index';

Expand All @@ -17,8 +17,6 @@ const renderComponent = (props = {}) =>
);

describe('<A />', () => {
afterEach(cleanup);

it('should render an <a> tag', () => {
const { container } = renderComponent();
expect(container.querySelector('a')).not.toBeNull();
Expand Down
4 changes: 1 addition & 3 deletions app/components/Button/tests/A.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { render, cleanup } from 'react-testing-library';
import { render } from 'react-testing-library';

import A from '../A';

describe('<A />', () => {
afterEach(cleanup);

it('should render an <a> tag', () => {
const { container } = render(<A />);
expect(container.querySelector('a')).not.toBeNull();
Expand Down
4 changes: 1 addition & 3 deletions app/components/Button/tests/StyledButton.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { render, cleanup } from 'react-testing-library';
import { render } from 'react-testing-library';

import StyledButton from '../StyledButton';

describe('<StyledButton />', () => {
afterEach(cleanup);

it('should render an <button> tag', () => {
const { container } = render(<StyledButton />);
expect(container.querySelector('button')).not.toBeNull();
Expand Down
4 changes: 1 addition & 3 deletions app/components/Button/tests/Wrapper.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { render, cleanup } from 'react-testing-library';
import { render } from 'react-testing-library';

import Wrapper from '../Wrapper';

describe('<Wrapper />', () => {
afterEach(cleanup);

it('should render an <div> tag', () => {
const { container } = render(<Wrapper />);
expect(container.querySelector('div')).not.toBeNull();
Expand Down
4 changes: 1 addition & 3 deletions app/components/Button/tests/index.test.js
Expand Up @@ -3,7 +3,7 @@
*/

import React from 'react';
import { cleanup, fireEvent, render } from 'react-testing-library';
import { fireEvent, render } from 'react-testing-library';

import Button from '../index';

Expand All @@ -18,8 +18,6 @@ const renderComponent = (props = {}) =>
);

describe('<Button />', () => {
afterEach(cleanup);

it('should render an <a> tag if no route is specified', () => {
const { container } = renderComponent({ href });
expect(container.querySelector('a')).not.toBeNull();
Expand Down
4 changes: 1 addition & 3 deletions app/components/Footer/tests/Wrapper.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import Wrapper from '../Wrapper';

describe('<Wrapper />', () => {
afterEach(cleanup);

it('should render an <footer> tag', () => {
const { container } = render(<Wrapper />);
expect(container.querySelector('footer')).not.toBeNull();
Expand Down
4 changes: 1 addition & 3 deletions app/components/H1/tests/index.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import H1 from '../index';

describe('<H1 />', () => {
afterEach(cleanup);

it('should render a prop', () => {
const id = 'testId';
const { container } = render(<H1 id={id} />);
Expand Down
4 changes: 1 addition & 3 deletions app/components/H2/tests/index.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import H2 from '../index';

describe('<H2 />', () => {
afterEach(cleanup);

it('should render a prop', () => {
const id = 'testId';
const { container } = render(<H2 id={id} />);
Expand Down
4 changes: 1 addition & 3 deletions app/components/H3/tests/index.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import H3 from '../index';

describe('<H3 />', () => {
afterEach(cleanup);

it('should render a prop', () => {
const id = 'testId';
const { container } = render(<H3 id={id} />);
Expand Down
4 changes: 1 addition & 3 deletions app/components/Header/tests/A.test.js
@@ -1,13 +1,11 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';
import renderer from 'react-test-renderer';
import 'jest-styled-components';

import A from '../A';

describe('<A />', () => {
afterEach(cleanup);

it('should match the snapshot', () => {
const renderedComponent = renderer.create(<A />).toJSON();
expect(renderedComponent).toMatchSnapshot();
Expand Down
4 changes: 1 addition & 3 deletions app/components/Header/tests/Img.test.js
@@ -1,13 +1,11 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';
import renderer from 'react-test-renderer';
import 'jest-styled-components';

import Img from '../Img';

describe('<Img />', () => {
afterEach(cleanup);

it('should match the snapshot', () => {
const renderedComponent = renderer
.create(<Img src="http://example.com/test.jpg" alt="test" />)
Expand Down
4 changes: 1 addition & 3 deletions app/components/Header/tests/index.test.js
@@ -1,5 +1,5 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';
import { Provider } from 'react-redux';
import { IntlProvider } from 'react-intl';
import { ConnectedRouter } from 'connected-react-router/immutable';
Expand All @@ -12,8 +12,6 @@ describe('<Header />', () => {
const history = createHistory();
const store = configureStore({}, history);

afterEach(cleanup);

it('should render a div', () => {
const { container } = render(
<Provider store={store}>
Expand Down
4 changes: 1 addition & 3 deletions app/components/Img/tests/index.test.js
@@ -1,5 +1,5 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import Img from '../index';

Expand All @@ -9,8 +9,6 @@ const renderComponent = (props = {}) =>
render(<Img src={src} alt={alt} {...props} />);

describe('<Img />', () => {
afterEach(cleanup);

it('should render an <img> tag', () => {
const { container } = renderComponent();
const element = container.querySelector('img');
Expand Down
4 changes: 1 addition & 3 deletions app/components/IssueIcon/tests/index.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import IssueIcon from '../index';

describe('<IssueIcon />', () => {
afterEach(cleanup);

it('should render a SVG', () => {
const { container } = render(<IssueIcon />);
expect(container.querySelector('svg')).not.toBeNull();
Expand Down
4 changes: 1 addition & 3 deletions app/components/List/tests/Ul.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import Ul from '../Ul';

describe('<Ul />', () => {
afterEach(cleanup);

it('should render an <ul> tag', () => {
const { container } = render(<Ul />);
const element = container.firstElementChild;
Expand Down
4 changes: 1 addition & 3 deletions app/components/List/tests/Wrapper.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import Wrapper from '../Wrapper';

describe('<Wrapper />', () => {
afterEach(cleanup);

it('should render an <div> tag', () => {
const { container } = render(<Wrapper />);
expect(container.firstElementChild.tagName).toEqual('DIV');
Expand Down
4 changes: 1 addition & 3 deletions app/components/List/tests/index.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import List from '../index';

describe('<List />', () => {
afterEach(cleanup);

it('should render the passed component if no items are passed', () => {
const component = () => <li>test</li>; // eslint-disable-line react/prop-types
const { container } = render(<List component={component} />);
Expand Down
4 changes: 1 addition & 3 deletions app/components/ListItem/tests/Item.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import Item from '../Item';

describe('<Item />', () => {
afterEach(cleanup);

it('should render an <div> tag', () => {
const { container } = render(<Item />);
expect(container.firstChild.tagName).toEqual('DIV');
Expand Down
4 changes: 1 addition & 3 deletions app/components/ListItem/tests/Wrapper.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import Wrapper from '../Wrapper';

describe('<Wrapper />', () => {
afterEach(cleanup);

it('should render an <li> tag', () => {
const { container } = render(<Wrapper />);
const element = container.querySelector('li');
Expand Down
4 changes: 1 addition & 3 deletions app/components/ListItem/tests/index.test.js
@@ -1,12 +1,10 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';
import 'jest-dom/extend-expect';

import ListItem from '../index';

describe('<ListItem />', () => {
afterEach(cleanup);

it('should have a class', () => {
const { container } = render(<ListItem className="test" />);
expect(container.querySelector('li').hasAttribute('class')).toBe(true);
Expand Down
4 changes: 1 addition & 3 deletions app/components/LoadingIndicator/tests/Circle.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import Circle from '../Circle';

describe('<Circle />', () => {
afterEach(cleanup);

it('should render an <div> tag', () => {
const { container } = render(<Circle />);
expect(container.firstChild.tagName).toEqual('DIV');
Expand Down
4 changes: 1 addition & 3 deletions app/components/LoadingIndicator/tests/Wrapper.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import Wrapper from '../Wrapper';

describe('<Wrapper />', () => {
afterEach(cleanup);

it('should render an <div> tag', () => {
const { container } = render(<Wrapper />);
expect(container.firstElementChild.tagName).toEqual('DIV');
Expand Down
4 changes: 1 addition & 3 deletions app/components/ReposList/tests/index.test.js
Expand Up @@ -2,14 +2,12 @@ import React from 'react';
import { IntlProvider } from 'react-intl';
import { Provider } from 'react-redux';
import { browserHistory } from 'react-router-dom';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import ReposList from '../index';
import configureStore from '../../../configureStore';

describe('<ReposList />', () => {
afterEach(cleanup);

it('should render the loading indicator when its loading', () => {
const { container } = render(<ReposList loading />);
expect(container.firstChild).toMatchSnapshot();
Expand Down
4 changes: 1 addition & 3 deletions app/components/Toggle/tests/Select.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import Select from '../Select';

describe('<Select />', () => {
afterEach(cleanup);

it('should render an <select> tag', () => {
const { container } = render(<Select />);
expect(container.firstChild.tagName).toEqual('SELECT');
Expand Down
4 changes: 1 addition & 3 deletions app/components/Toggle/tests/index.test.js
@@ -1,12 +1,10 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';
import { IntlProvider, defineMessages } from 'react-intl';

import Toggle from '../index';

describe('<Toggle />', () => {
afterEach(cleanup);

it('should contain default text', () => {
const defaultEnMessage = 'someContent';
const defaultDeMessage = 'someOtherContent';
Expand Down
4 changes: 1 addition & 3 deletions app/components/ToggleOption/tests/index.test.js
@@ -1,12 +1,10 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';
import { IntlProvider, defineMessages } from 'react-intl';

import ToggleOption from '../index';

describe('<ToggleOption />', () => {
afterEach(cleanup);

it('should render default language messages', () => {
const defaultEnMessage = 'someContent';
const message = defineMessages({
Expand Down
4 changes: 1 addition & 3 deletions app/containers/FeaturePage/tests/List.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import List from '../List';

describe('<List />', () => {
afterEach(cleanup);

it('should render an <ul> tag', () => {
const {
container: { firstChild },
Expand Down
4 changes: 1 addition & 3 deletions app/containers/FeaturePage/tests/ListItem.test.js
@@ -1,11 +1,9 @@
import React from 'react';
import { cleanup, render } from 'react-testing-library';
import { render } from 'react-testing-library';

import ListItem from '../ListItem';

describe('<ListItem />', () => {
afterEach(cleanup);

it('should render an <li> tag', () => {
const {
container: { firstChild },
Expand Down

0 comments on commit ea14356

Please sign in to comment.