-
Notifications
You must be signed in to change notification settings - Fork 42
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
Daniel Schmidt
committed
Apr 13, 2018
1 parent
e0800ab
commit 5909c67
Showing
15 changed files
with
102 additions
and
134 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import "storybook-readme/register"; | ||
import '@storybook/addon-knobs/register' | ||
import "@storybook/addon-knobs/register"; | ||
import "@storybook/addon-options/register"; | ||
import "@storybook/addon-actions/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
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,5 +1,3 @@ | ||
module.exports = { | ||
extends: [ | ||
"@commitlint/config-conventional" | ||
] | ||
extends: ["@commitlint/config-conventional"] | ||
}; |
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,53 +1,55 @@ | ||
import React from "react"; | ||
import Badge from '../badge'; | ||
import renderer from 'react-test-renderer'; | ||
import Badge from "../badge"; | ||
import renderer from "react-test-renderer"; | ||
|
||
const StringComponent = () : JSX.Element => { | ||
return ( | ||
<span>string</span> | ||
) | ||
const StringComponent = (): JSX.Element => { | ||
return <span>string</span>; | ||
}; | ||
|
||
describe("Badge", () => { | ||
it("default", () => { | ||
expect(renderer | ||
.create(<Badge>default</Badge>) | ||
.toJSON()).toMatchSnapshot() | ||
expect(renderer.create(<Badge>default</Badge>).toJSON()).toMatchSnapshot(); | ||
}); | ||
|
||
it("success", () => { | ||
expect(renderer | ||
.create(<Badge appearance="success">success</Badge>) | ||
.toJSON()).toMatchSnapshot() | ||
expect( | ||
renderer.create(<Badge appearance="success">success</Badge>).toJSON() | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
it("primary", () => { | ||
expect(renderer | ||
.create(<Badge appearance="primary">primary</Badge>) | ||
.toJSON()).toMatchSnapshot() | ||
expect( | ||
renderer.create(<Badge appearance="primary">primary</Badge>).toJSON() | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
it("danger", () => { | ||
expect(renderer | ||
.create(<Badge appearance="danger">danger</Badge>) | ||
.toJSON()).toMatchSnapshot() | ||
expect( | ||
renderer.create(<Badge appearance="danger">danger</Badge>).toJSON() | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
it("warning", () => { | ||
expect(renderer | ||
.create(<Badge appearance="warning">warning</Badge>) | ||
.toJSON()).toMatchSnapshot() | ||
expect( | ||
renderer.create(<Badge appearance="warning">warning</Badge>).toJSON() | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
it("outline", () => { | ||
expect(renderer | ||
.create(<Badge appearance="outline">outline</Badge>) | ||
.toJSON()).toMatchSnapshot() | ||
expect( | ||
renderer.create(<Badge appearance="outline">outline</Badge>).toJSON() | ||
).toMatchSnapshot(); | ||
}); | ||
|
||
it("accept jsx as children", () => { | ||
expect(renderer | ||
.create(<Badge><StringComponent /></Badge>) | ||
.toJSON()).toMatchSnapshot() | ||
expect( | ||
renderer | ||
.create( | ||
<Badge> | ||
<StringComponent /> | ||
</Badge> | ||
) | ||
.toJSON() | ||
).toMatchSnapshot(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,10 +1,6 @@ | ||
{ | ||
"extends": [ | ||
"@dcos/tslint-config" | ||
], | ||
"extends": ["@dcos/tslint-config"], | ||
"linterOptions": { | ||
"exclude": [ | ||
"./scripts/templates/*" | ||
] | ||
"exclude": ["./scripts/templates/*"] | ||
} | ||
} |
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.