-
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.
Add tests for ExampleWork and ExampleWorkBubble component
- Loading branch information
1 parent
fe7daaf
commit 3de8e14
Showing
2 changed files
with
49 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import ExampleWork, { ExampleWorkBubble } from '/Users/u0174059/Documents/code/bg-portfolio/js/example-work.js'; | ||
|
||
|
||
import Enzyme from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
Enzyme.configure({ adapter: new Adapter() }); | ||
|
||
const myWork = [ | ||
{ | ||
'title': "AWS Cloud Project Example", | ||
'image': { | ||
'desc': "example screenshot of a project involving code", | ||
'src': "images/example1.png", | ||
'comment': "" | ||
} | ||
}, | ||
{ | ||
'title': "Prod-DR work Example", | ||
'image': { | ||
'desc': "example screenshot of a project involving chemistry", | ||
'src': "images/example2.png", | ||
'comment': "" | ||
} | ||
} | ||
]; | ||
|
||
describe("ExampleWork component", () => { | ||
let component = shallow(<ExampleWork work={myWork}/>); | ||
|
||
it("Should be a 'section' element", () => { | ||
except(component.type()).toEqual('section'); | ||
|
||
}); | ||
}); | ||
|
||
describe("ExampleWorkBubble component", () => { | ||
let component = shallow(<ExampleWorkBubble example={myWork[1]}/>); | ||
|
||
let images = component.find("img"); | ||
|
||
it("SHould contain a single 'img' element", () => { | ||
expect(images.length).toEqual(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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["react","env"] | ||
} |