forked from hackforla/VRMS
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathApp.test.js
More file actions
41 lines (35 loc) · 1.27 KB
/
App.test.js
File metadata and controls
41 lines (35 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React from 'react';
import App from './App';
import { render, screen, cleanup } from '@testing-library/react';
import { BRIGADE_NAME } from '../src/utils/themes/themes.js';
beforeEach(() => {
render(<App />);
});
afterEach(cleanup);
describe('App', () => {
test('Should render and displays name of project', () => {
const h1 = screen.getAllByText(/VRMS/i)[0];
const h2 = screen.getByText(/Volunteer Relationship Management System/i);
expect(h1).toBeInTheDocument();
expect(h2).toBeInTheDocument();
});
test('Should render with header and logo', () => {
expect(screen.getByTestId('header')).toBeInTheDocument();
expect(screen.getByTestId('logo')).toBeInTheDocument();
});
test('Should render with main section', () => {
expect(screen.getByTestId('main')).toBeInTheDocument();
});
test('Should exist `sign in` and `create account` buttons', () => {
expect(screen.getByText('Sign in')).toBeInTheDocument();
expect(screen.getByText('Create account')).toBeInTheDocument();
});
if (BRIGADE_NAME === "Hack for LA") {
test('Should render with footer', () => {
expect(screen.getByTestId('footer')).toBeInTheDocument();
expect(
screen.getByText('was developed by Hack for LA')
).toBeInTheDocument();
});
}
});