-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InputBase] Improve documentation for custom
inputComponent
(#16399)
* [docs] Explain `inputRef` implementation concept * [InputBase] Improve error message for custom inputComponent * Add value to interface * inputComponet-ref-interface -> input-component-ref-interface * Adjust redirect for new heading * Add failing test for code being considered possible demo marker * Fix malformed markdown at }} }} can come from code formatting of JSX attributes * Fix failing browser test * fix browser fail * Test closer to user implementation * Add tests for possible implementations for inputComponent * Fix browser test
- Loading branch information
Showing
13 changed files
with
181 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { expect } from 'chai'; | ||
import { getContents } from './parseMarkdown'; | ||
|
||
describe('parseMarkdown', () => { | ||
describe('getContents', () => { | ||
describe('Split markdown into an array, separating demos', () => { | ||
it('returns a single entry without a demo', () => { | ||
expect(getContents('# SomeGuide\nwhich has no demo')).to.deep.equal([ | ||
'# SomeGuide\nwhich has no demo', | ||
]); | ||
}); | ||
|
||
it('uses a `{{"demo"` marker to split', () => { | ||
expect( | ||
getContents('# SomeGuide\n{{"demo": "GuideDemo.js" }}\n## NextHeading'), | ||
).to.deep.equal(['# SomeGuide\n', '"demo": "GuideDemo.js" ', '\n## NextHeading']); | ||
}); | ||
|
||
it('ignores possible code', () => { | ||
expect(getContents('# SomeGuide\n```jsx\n<Button props={{\nfoo: 1\n}}')).to.deep.equal([ | ||
'# SomeGuide\n```jsx\n<Button props={{\nfoo: 1\n}}', | ||
]); | ||
}); | ||
}); | ||
}); | ||
}); |
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
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