[fix] Image tests

This commit is contained in:
Nicolas Gallagher
2015-12-01 15:50:38 -08:00
parent 6db24e9358
commit 8cfef85934
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ const styles = StyleSheet.create({
backgroundColor: 'lightgray', backgroundColor: 'lightgray',
backgroundPosition: 'center', backgroundPosition: 'center',
backgroundRepeat: 'no-repeat', backgroundRepeat: 'no-repeat',
backgroundSize: '100% 100%' backgroundSize: 'cover'
}, },
img: { img: {
borderWidth: 0, borderWidth: 0,
@@ -88,17 +88,18 @@ suite('components/TextInput', () => {
test('prop "maxNumberOfLines"', () => { test('prop "maxNumberOfLines"', () => {
const style = { borderWidth: 0, fontSize: 20, lineHeight: 1 } const style = { borderWidth: 0, fontSize: 20, lineHeight: 1 }
const value = (() => { const generateValue = () => {
let str = '' let str = ''
while (str.length < 100) str += 'x' while (str.length < 100) str += 'x'
return str return str
}()) }
let dom = utils.renderAndInject( let dom = utils.renderAndInject(
<TextInput <TextInput
maxNumberOfLines={3} maxNumberOfLines={3}
multiline multiline
style={style} style={style}
value={value} value={generateValue()}
/> />
) )
const height = dom.getBoundingClientRect().height const height = dom.getBoundingClientRect().height