-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Support react 16.0 and upgrade development dependencies. close #14
- Loading branch information
Showing
9 changed files
with
2,710 additions
and
1,417 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 +1,5 @@ | ||
jest.mock('../facade'); | ||
|
||
global.requestAnimationFrame = function(callback) { | ||
setTimeout(callback, 0); | ||
}; |
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,146 +1,117 @@ | ||
|
||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
import expect from 'expect'; | ||
|
||
import { | ||
storiesOf, | ||
describe, | ||
it, | ||
specs, | ||
} from '../facade'; | ||
import { storiesOf, describe, it, specs } from '../facade'; | ||
|
||
import GitHubForkRibbon from '../../src'; | ||
|
||
const stories = storiesOf('GitHub fork ribbon', module); | ||
|
||
stories.add('default with right position and red color', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); | ||
|
||
stories.add('handle unexist position with default', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank" | ||
position="WOW"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank" position="WOW"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); | ||
|
||
stories.add('handle unexist color with default', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank" | ||
color="Hi"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank" color="Hi"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); | ||
|
||
stories.add('on right position', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank" | ||
position="right"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank" position="right"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); | ||
|
||
stories.add('on left position', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank" | ||
position="left"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank" position="left"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); | ||
|
||
stories.add('on right-bottom position', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank" | ||
position="right-bottom"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank" position="right-bottom"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); | ||
|
||
stories.add('on left-bottom position', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank" | ||
position="left-bottom"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank" position="left-bottom"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); | ||
|
||
stories.add('with red color', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank" | ||
color="red"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank" color="red"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); | ||
|
||
stories.add('with orange color', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank" | ||
color="orange"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank" color="orange"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); | ||
|
||
stories.add('with black color', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank" | ||
color="black"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank" color="black"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); | ||
|
||
stories.add('with green color', () => { | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" | ||
target="_blank" | ||
color="green"> | ||
const component = ( | ||
<GitHubForkRibbon href="//www.google.com" target="_blank" color="green"> | ||
Fork me on GitHub | ||
</GitHubForkRibbon> | ||
); | ||
); | ||
|
||
return component; | ||
return component; | ||
}); |
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,2 +1,3 @@ | ||
import 'storybook-addon-specifications/register'; | ||
import '@kadira/storybook/addons'; | ||
import '@storybook/addon-actions/register'; | ||
import '@storybook/addon-links/register'; |
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,9 +1,8 @@ | ||
|
||
import { configure } from '@kadira/storybook'; | ||
import { configure } from '@storybook/react'; | ||
|
||
const req = require.context('./__tests__/', true, /stories\.js$/); | ||
|
||
function loadStories() { | ||
req.keys().forEach(req); | ||
req.keys().forEach(req); | ||
} | ||
configure(loadStories, module); |
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.