-
Notifications
You must be signed in to change notification settings - Fork 20
/
Home.test.js
40 lines (32 loc) · 1.13 KB
/
Home.test.js
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
import React from 'react'
import Home from './Home'
import { shallow } from 'enzyme'
// Need at least 1 test to pass Travis CI
describe('<Home />', () => {
let homeWrapper
beforeEach(() => {
homeWrapper = shallow(<Home />)
})
it("contains the headline 'Drive the change with music'", () => {
expect(homeWrapper.find('h1').text()).toEqual(
'Drive the change with music'
)
})
it('contains a call to action button', () => {
expect(homeWrapper.find('.home-container__intro button').length).toEqual(1)
})
it('contains 3 mood images about artists', () => {
expect(homeWrapper.find('.home-container__intro img').length).toEqual(3)
})
it('contains a section about how to register', () => {
expect(homeWrapper.find('.home-container__registration').length).toEqual(1)
})
it('contains 3 possible registration opportunities', () => {
expect(homeWrapper.find('.registration-option-card').length).toEqual(3)
})
it('each of the 3 cards has a button which leads to the registration accordingly', () => {
expect(homeWrapper.find('.registration-option-card button').length).toEqual(
3
)
})
})