forked from USStateDept/State-TalentMAP
-
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.
Merge pull request #1217 from MetaPhase-Consulting/chore/increase-tes…
…t-coverage increasing test coverage
- Loading branch information
Showing
15 changed files
with
359 additions
and
12 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 |
---|---|---|
@@ -1,10 +1,42 @@ | ||
import { shallow } from 'enzyme'; | ||
import toJSON from 'enzyme-to-json'; | ||
import Success from './Success'; | ||
import detailsObject from '../../__mocks__/detailsObject'; | ||
|
||
describe('Success', () => { | ||
const props = { | ||
client: { | ||
perdet_seq_number: 12345, | ||
name: 'Woodard, Wendy', | ||
}, | ||
hideLink: false, | ||
}; | ||
|
||
it('is defined', () => { | ||
const wrapper = shallow(<Success pos={detailsObject} />); | ||
const wrapper = shallow(<Success pos={detailsObject} {...props} />); | ||
expect(wrapper).toBeDefined(); | ||
expect(wrapper.find('Link') | ||
.exists()).toBe(true); | ||
}); | ||
|
||
it('hides link', () => { | ||
const wrapper = shallow(<Success pos={detailsObject} {...props} hideLink />); | ||
expect(wrapper.find('Link') | ||
.exists()).toBe(false); | ||
}); | ||
|
||
it('renders public profile link when given perdet', () => { | ||
const wrapper = shallow(<Success pos={detailsObject} {...props} />); | ||
expect(wrapper.find('Link').prop('to')).toBe('/profile/bidtracker/public/12345/'); | ||
}); | ||
|
||
it('renders basic link', () => { | ||
const wrapper = shallow(<Success pos={detailsObject} />); | ||
expect(wrapper.find('Link').prop('to')).toBe('/profile/bidtracker/'); | ||
}); | ||
|
||
it('matches snapshot', () => { | ||
const wrapper = shallow(<Success pos={detailsObject} {...props} />); | ||
expect(toJSON(wrapper)).toMatchSnapshot(); | ||
}); | ||
}); |
21 changes: 21 additions & 0 deletions
21
src/Components/BidListMessages/__snapshots__/Success.test.jsx.snap
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,21 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Success matches snapshot 1`] = ` | ||
<span> | ||
Test Position | ||
( | ||
00003027 | ||
) has been successfully added to Bid List. | ||
<span> | ||
<Link | ||
replace={false} | ||
to="/profile/bidtracker/public/12345/" | ||
> | ||
Go to | ||
Woodard, Wendy's' | ||
Bid Tracker | ||
</Link> | ||
. | ||
</span> | ||
</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
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
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
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
Oops, something went wrong.