forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Demo codesandbox deps (mui#10158)
- Loading branch information
1 parent
98e065e
commit 2239f6f
Showing
7 changed files
with
78 additions
and
34 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
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,52 @@ | ||
import { assert } from 'chai'; | ||
import { getDependencies } from './helpers'; | ||
|
||
const s1 = `import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { withStyles } from 'material-ui/styles'; | ||
import Input, { InputLabel } from 'material-ui/Input'; | ||
import { FormControl, FormHelperText } from 'material-ui/Form'; | ||
import Select from 'material-ui/Select'; | ||
import FooBar, { Qux } from '@foo-bar/bip'; | ||
const styles = theme => ({ | ||
container: { | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
}, | ||
formContro | ||
`; | ||
|
||
const s2 = `import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import * as _ from '@unexisting/thing'; | ||
import Autosuggest from 'react-autosuggest'; | ||
import match from 'autosuggest-highlight/match'; | ||
import parse from 'autosuggest-highlight/parse'; | ||
import TextField from 'material-ui/TextField'; | ||
import Paper from 'material-ui/Paper'; | ||
import { MenuItem } from 'material-ui/Menu'; | ||
import { withStyles } from 'material-ui/styles'; | ||
const suggestions = [`; | ||
|
||
describe('docs getDependencies helpers', () => { | ||
it('generate the right npm dependencies', () => { | ||
assert.deepEqual(getDependencies(s1), { | ||
react: 'latest', | ||
'react-dom': 'latest', | ||
'material-ui': 'next', | ||
'prop-types': 'latest', | ||
'@foo-bar/bip': 'latest', | ||
}); | ||
assert.deepEqual(getDependencies(s2), { | ||
react: 'latest', | ||
'react-dom': 'latest', | ||
'material-ui': 'next', | ||
'prop-types': 'latest', | ||
'@unexisting/thing': 'latest', | ||
'react-autosuggest': 'latest', | ||
'autosuggest-highlight': 'latest', | ||
}); | ||
}); | ||
}); |
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