This repository has been archived by the owner on Feb 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from FormidableLabs/task-updateDocsAndSupportE…
…mptyPropTypes Update docs and support empty prop types
- Loading branch information
Showing
6 changed files
with
55 additions
and
6 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 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
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,43 @@ | ||
import React from "react/addons"; | ||
|
||
import API from "src/components/api"; | ||
|
||
const TestUtils = React.addons.TestUtils; | ||
|
||
describe("components/api", function () { | ||
|
||
it("renders propType documentation table", function () { | ||
const renderer = TestUtils.createRenderer(); | ||
const sourceFake = { | ||
props: { | ||
name: { | ||
name: "propName", | ||
required: false, | ||
type: { | ||
name: "string" | ||
}, | ||
description: "Name description\n@examples \"propValue1\"", | ||
defaultValue: { | ||
computed: false, | ||
value: "test" | ||
} | ||
} | ||
} | ||
}; | ||
renderer.render(<API source={sourceFake} />); | ||
|
||
const output = renderer.getRenderOutput(); | ||
|
||
expect(output.type).to.equal("table"); | ||
}); | ||
|
||
it("renders default message when proptypes are missing", function () { | ||
const renderer = TestUtils.createRenderer(); | ||
const sourceFake = { props: null }; | ||
renderer.render(<API source={sourceFake} />); | ||
|
||
const output = renderer.getRenderOutput(); | ||
|
||
expect(output.type).to.equal("em"); | ||
}); | ||
}); |
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