stub tests for page components

This commit is contained in:
Sorrel Bri 2020-01-15 21:59:05 -08:00
parent dfd1268939
commit 194fc9155e
12 changed files with 57 additions and 12 deletions

View file

@ -2,7 +2,7 @@ import React from 'react';
import { render } from '@testing-library/react'; import { render } from '@testing-library/react';
import Login from './Login'; import Login from './Login';
test('renders app without crashing', () => { test('renders Login without crashing', () => {
const { getByTestId } = render(<Login />); const { getByTestId } = render(<Login />);
const LoginDiv = getByTestId('Login'); const LoginDiv = getByTestId('Login');
expect(LoginDiv).toBeInTheDocument(); expect(LoginDiv).toBeInTheDocument();

View file

@ -2,7 +2,7 @@ import React from 'react';
import { render } from '@testing-library/react'; import { render } from '@testing-library/react';
import Signup from './Signup'; import Signup from './Signup';
test('renders app without crashing', () => { test('renders Signup without crashing', () => {
const { getByTestId } = render(<Signup />); const { getByTestId } = render(<Signup />);
const SignupDiv = getByTestId('Signup'); const SignupDiv = getByTestId('Signup');
expect(SignupDiv).toBeInTheDocument(); expect(SignupDiv).toBeInTheDocument();

View file

@ -3,9 +3,9 @@ import './Account.scss';
const Account = () => { const Account = () => {
return ( return (
<> <div className="Account" data-testid="Account">
<p>Account</p> <p>Account</p>
</> </div>
); );
} }

View file

@ -0,0 +1,9 @@
import React from 'react';
import { render } from '@testing-library/react';
import Account from './Account';
test('renders Account without crashing', () => {
const { getByTestId } = render(<Account />);
const AccountDiv = getByTestId('Account');
expect(AccountDiv).toBeInTheDocument();
});

View file

@ -3,9 +3,9 @@ import './Game.scss';
const Game = () => { const Game = () => {
return ( return (
<> <div className="Game" data-testid="Game">
<p>Game</p> <p>Game</p>
</> </div>
); );
} }

View file

@ -0,0 +1,9 @@
import React from 'react';
import { render } from '@testing-library/react';
import Game from './Game';
test('renders Game without crashing', () => {
const { getByTestId } = render(<Game />);
const GameDiv = getByTestId('Game');
expect(GameDiv).toBeInTheDocument();
});

View file

@ -3,9 +3,9 @@ import './Home.scss';
const Home = () => { const Home = () => {
return ( return (
<> <div className="Home" data-testid="Home">
<p>Home</p> <p>Home</p>
</> </div>
); );
} }

View file

@ -0,0 +1,9 @@
import React from 'react';
import { render } from '@testing-library/react';
import Home from './Home';
test('renders Home without crashing', () => {
const { getByTestId } = render(<Home />);
const HomeDiv = getByTestId('Home');
expect(HomeDiv).toBeInTheDocument();
});

View file

@ -3,9 +3,9 @@ import './News.scss';
const News = () => { const News = () => {
return ( return (
<> <div className="News" data-testid="News">
<p>News</p> <p>News</p>
</> </div>
); );
} }

View file

@ -0,0 +1,9 @@
import React from 'react';
import { render } from '@testing-library/react';
import News from './News';
test('renders News without crashing', () => {
const { getByTestId } = render(<News />);
const NewsDiv = getByTestId('News');
expect(NewsDiv).toBeInTheDocument();
});

View file

@ -3,9 +3,9 @@ import './Room.scss';
const Room = () => { const Room = () => {
return ( return (
<> <div className="Room" data-testid="Room">
<p>Room</p> <p>Room</p>
</> </div>
); );
} }

View file

@ -0,0 +1,9 @@
import React from 'react';
import { render } from '@testing-library/react';
import Room from './Room';
test('renders Room without crashing', () => {
const { getByTestId } = render(<Room />);
const RoomDiv = getByTestId('Room');
expect(RoomDiv).toBeInTheDocument();
});