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.
Merge remote-tracking branch 'call_em_all_-_master/master' (#43)
* call_em_all_-_master/master: [docs] Promote the v1.0.0-alpha (mui#7273) Issue 7175 (mui#7260) Fix regressions (mui#7262) [tests] correct values expected by autoprefixer (mui#7267) # Conflicts: # src/internal/FocusRipple.js * fixed step to have a default array of no children, as without it the tests were failing
- Loading branch information
Showing
9 changed files
with
81 additions
and
13 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
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 @@ | ||
/* eslint-env mocha */ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import {mount} from 'enzyme'; | ||
import {assert} from 'chai'; | ||
import EnhancedTextarea from './EnhancedTextarea'; | ||
import getMuiTheme from '../styles/getMuiTheme'; | ||
|
||
describe('<EnhancedTextArea />', () => { | ||
const muiTheme = getMuiTheme(); | ||
const rowHeight = 24; | ||
const mountWithContext = (node) => mount(node, { | ||
context: {muiTheme}, | ||
childContextTypes: {muiTheme: PropTypes.object}, | ||
}); | ||
|
||
it('renders with no arguments', () => { | ||
const wrapper = mountWithContext( | ||
<EnhancedTextarea /> | ||
); | ||
assert.isAbove(wrapper.find('div').length, 0); | ||
}); | ||
|
||
it('has one row initial height', () => { | ||
const wrapper = mountWithContext( | ||
<EnhancedTextarea /> | ||
); | ||
assert.strictEqual(wrapper.state().height, rowHeight); | ||
}); | ||
|
||
// This test will not succeed due to | ||
// jsdom limitations | ||
// https://github.com/tmpvar/jsdom/issues/1013 | ||
/* eslint mocha/no-skipped-tests: 0 */ | ||
it.skip('has zero initial height', () => { | ||
const wrapper = mountWithContext( | ||
<EnhancedTextarea | ||
value="A really long string that should go over multiple lines and should trigger more rows than one" | ||
/> | ||
); | ||
assert.isAbove(wrapper.state().height, rowHeight); | ||
}); | ||
}); |
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