Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Commit

Permalink
Better test coverage in modal
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed Aug 18, 2016
1 parent 3e0f4d1 commit 130a817
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/Modal/__tests__/__snapshots__/index-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,48 @@ exports[`Modal renders an alert modal 1`] = `
</div>
`;

exports[`Modal renders an confirm modal 1`] = `
<div>
<button
handleOpen={[Function anonymous]}>
Open
</button>
<div
aria-hidden={false}
className="uk-modal"
onClick={false}
style={
Object {
"display": false
}
}>
<div
className="uk-modal-dialog"
onClick={[Function anonymous]}>
Are you absolutely sure about this?
<div
className="uk-modal-footer uk-text-right">
<button
className="uk-button"
onClick={[Function anonymous]}
type="button">
Cancel
</button>
<span>
 
</span>
<button
className="uk-button uk-button-primary"
onClick={[Function anonymous]}
type="button">
Ok
</button>
</div>
</div>
</div>
</div>
`;

exports[`Modal renders correctly 1`] = `
<div>
<button
Expand Down
11 changes: 11 additions & 0 deletions src/Modal/__tests__/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,15 @@ describe('Modal', () => {
)
expect(component.toJSON()).toMatchSnapshot()
})

it('renders an confirm modal', () => {
const component = renderer.create(
<Modal
type="confirm"
>
Are you absolutely sure about this?
</Modal>
)
expect(component.toJSON()).toMatchSnapshot()
})
})

0 comments on commit 130a817

Please sign in to comment.