This repository has been archived by the owner on Nov 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 parent
73a3ad2
commit d3a2fc1
Showing
22 changed files
with
115 additions
and
98 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,13 @@ | ||
language: node_js | ||
node_js: | ||
- stable | ||
|
||
jobs: | ||
include: | ||
- stage: "Tests" | ||
name: "Unit Tests" | ||
script: yarn && yarn test | ||
|
||
branches: | ||
only: | ||
- master |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import Badge from './index'; | ||
import { shallow } from 'enzyme'; | ||
|
||
describe('Badge', () => { | ||
it('badge not showing count === 0', () => { | ||
const badge = shallow(<Badge count={0} />); | ||
expect(badge.find('.Badge').exists()).toEqual(false); | ||
}); | ||
it('badge showing count === 0 with showZero', () => { | ||
const badge = shallow(<Badge count={0} showZero />); | ||
expect(badge.find('.Badge').length).toBe(1); | ||
expect(badge.text()).toEqual('0'); | ||
}); | ||
it('default status danger', () => { | ||
const badge = shallow(<Badge count="default" />); | ||
expect(badge.find('.Badge--danger').exists()).toEqual(true); | ||
}); | ||
it('number over 99 will be set to 99+', () => { | ||
const badge = shallow(<Badge count={500} />); | ||
expect(badge.text()).toEqual('99+'); | ||
}); | ||
it('overflowCount can be set', () => { | ||
const badge = shallow(<Badge count={10000} overflowCount={999} />); | ||
expect(badge.text()).toEqual('999+'); | ||
}); | ||
it('badge showing tip with children', () => { | ||
const badge = shallow(<Badge count="2000">UI</Badge>); | ||
expect(badge.find('.Badge__wrapper').exists()).toEqual(true); | ||
}); | ||
}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 @@ | ||
export * from './components/index'; |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
/// <reference types="react-scripts" /> |
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,10 @@ | ||
/** | ||
* https://github.com/xsky-fe/create-react-app-wizard/blob/master/packages/react-scripts/scripts/utils/createJestConfig.js#L28 | ||
* https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#testing-components | ||
**/ | ||
import { configure } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
|
||
configure ({ | ||
adapter: new Adapter (), | ||
}) |
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.