-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#24 added rendering tests for Header and Footer
- Loading branch information
Showing
5 changed files
with
71 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,29 +4,29 @@ import './footer.css' | |
const Footer = () => { | ||
const version = APP_VERSION || null | ||
return ( | ||
<footer className="footer"> | ||
<footer className="footer" data-test="component-footer"> | ||
<div className="container-fluid"> | ||
<div className="row"> | ||
<div className="col-lg"> | ||
<nav className="float-lg-left"> | ||
<ul> | ||
<li> | ||
<a href="https://github.com/owlbeardm/equipment">GitHub</a> | ||
<a href="https://github.com/owlbeardm/equipment" data-test="social-link">GitHub</a> | ||
</li> | ||
<li> | ||
<a href="https://twitter.com/OwlbearDm">Twitter</a> | ||
<a href="https://twitter.com/OwlbearDm" data-test="social-link">Twitter</a> | ||
</li> | ||
<li> | ||
<a href="mailto:[email protected]?subject=Scrollbear: ">Email Me</a> | ||
<a href="mailto:[email protected]?subject=Scrollbear: " data-test="social-link">Email Me</a> | ||
</li> | ||
<li> | ||
<a href="https://c7d5a6.com/">Contacts</a> | ||
<a href="https://c7d5a6.com/" data-test="social-link">Contacts</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
<div className="col-lg-auto"> | ||
<div className="copyright float-lg-right"> | ||
<div className="copyright float-lg-right" data-test="project-credits"> | ||
<div className="row"> | ||
<div className="col-lg-auto pr-1"> | ||
<span>© Nadzeya Ivashchanka & Mikita Kukavenka,</span> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react' | ||
import { shallow } from 'enzyme' | ||
|
||
import Footer from './footer' | ||
|
||
const setup = () => shallow(<Footer />) | ||
|
||
describe('rendering testing', () => { | ||
let wrapper | ||
|
||
beforeEach(() => { | ||
wrapper = setup() | ||
}) | ||
|
||
test('renders without error', () => { | ||
const appComponent = wrapper.find("[data-test='component-footer']") | ||
expect(appComponent.length).toBe(1) | ||
}) | ||
|
||
test('contains four social media links', () => { | ||
const appComponent = wrapper.find("a[data-test='social-link']") | ||
expect(appComponent.length).toBe(4) | ||
}) | ||
|
||
test('contains credits', () => { | ||
const appComponent = wrapper.find("[data-test='project-credits']") | ||
expect(appComponent.length).toBe(1) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react' | ||
import { shallow } from 'enzyme' | ||
|
||
import Header from './header' | ||
|
||
const setup = () => shallow(<Header />) | ||
|
||
describe('rendering testing', () => { | ||
let wrapper | ||
|
||
beforeEach(() => { | ||
wrapper = setup() | ||
}) | ||
|
||
test('renders without error', () => { | ||
const appComponent = wrapper.find("[data-test='component-header']") | ||
expect(appComponent.length).toBe(1) | ||
}) | ||
|
||
test('contains app logo', () => { | ||
const appComponent = wrapper.find("[data-test='app-logo']") | ||
expect(appComponent.length).toBe(1) | ||
}) | ||
|
||
test('contains project name', () => { | ||
const appComponent = wrapper.find("[data-test='project-name']") | ||
expect(appComponent.length).toBe(1) | ||
}) | ||
}) |