-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JasonLantz
committed
Jan 13, 2017
1 parent
a048da6
commit 4dff8b0
Showing
5 changed files
with
110 additions
and
95 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
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 |
---|---|---|
|
@@ -33,7 +33,7 @@ svg { | |
} | ||
|
||
@keyframes openAlert { | ||
0% { top: -500px; } | ||
0% { top: -700px; } | ||
100% { top: 0px; } | ||
} | ||
|
||
|
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,65 @@ | ||
import expect from 'expect'; | ||
import expectJSX from 'expect-jsx'; | ||
import React from 'react'; | ||
import { createRenderer } from 'react-addons-test-utils'; | ||
import Alert from '../../src/js/Alert'; | ||
import Icon from '../../src/js/icon'; | ||
import { shallow } from 'enzyme'; | ||
import { jsdom } from 'jsdom'; | ||
|
||
expect.extend(expectJSX); | ||
|
||
describe('Alert', () => { | ||
describe('Basic Alert Test', () => { | ||
beforeEach(function() { | ||
global.window = jsdom(undefined, { url: 'about:blank' }).defaultView; | ||
global.document = global.window.document; | ||
this.wrapper = shallow(<Alert>Test Alert</Alert>); | ||
}); | ||
|
||
it('should render the Alert', function() { | ||
expect(this.wrapper.node.type).toEqual('li'); | ||
}); | ||
|
||
it('should render Alert', () => { | ||
|
||
const index = 1; | ||
const closeIndex = 1; | ||
const alertType = 'success'; | ||
const alertMessage = 'hi'; | ||
const handleClose = () => {}; | ||
const hasClicked = false; | ||
|
||
let renderer = createRenderer(); | ||
|
||
renderer.render(<Alert | ||
index = {index} | ||
closeIndex = {closeIndex} | ||
key = {index} | ||
alertType = {alertType} | ||
alertMessage = {alertMessage} | ||
handleClose = {handleClose} | ||
/>); | ||
|
||
let actualElement = renderer.getRenderOutput(); | ||
let actualElementClicked = renderer.getRenderOutput().props.onClick(); | ||
|
||
// expect(actualElement).toEqualJSX( | ||
// <li | ||
// className = {(index !== closeIndex) ? `pe-alert` : `pe-alert pe-alert close-title-animation`} | ||
// id = {`alert-${alertType}-${index}`} | ||
// role = "alert"> | ||
// <strong className={`pe-label ${alertType}-title`}>{alertType}</strong> | ||
// <button className="close-title" onClick={handleClose} aria-label="Close alert"> | ||
// <Icon name="remove-lg-18" /> | ||
// </button><br/> | ||
// <span className="pe-copy">{alertMessage}</span> | ||
// | ||
// </li> | ||
// ); | ||
|
||
|
||
}); | ||
|
||
}); | ||
}); |
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