From 39b2b2f97919dd9c5211e461ab47b694af2817e9 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Sun, 20 Dec 2015 04:26:59 -0800 Subject: [PATCH] Fix unreliable TextInput tests --- .../TextInput/__tests__/index-test.js | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/TextInput/__tests__/index-test.js b/src/components/TextInput/__tests__/index-test.js index 2f7eb809..bf5f65a6 100644 --- a/src/components/TextInput/__tests__/index-test.js +++ b/src/components/TextInput/__tests__/index-test.js @@ -97,17 +97,14 @@ suite('components/TextInput', () => { return str } - let input = findInput(utils.renderAndInject( + const result = utils.shallowRender( - )) - const height = input.getBoundingClientRect().height - // need a range because of cross-browser differences - assert.ok(height >= 42, height) - assert.ok(height <= 48, height) + ) + assert.equal(findShallowInput(result).props.maxRows, 3) }) test('prop "multiline"', () => { @@ -126,10 +123,14 @@ suite('components/TextInput', () => { // with multiline input = findInput(utils.renderAndInject()) assert.equal(input.tagName, 'TEXTAREA') - const height = input.getBoundingClientRect().height - // need a range because of cross-browser differences - assert.ok(height >= 30, height) - assert.ok(height <= 36, height) + + const result = utils.shallowRender( + + ) + assert.equal(findShallowInput(result).props.minRows, 3) }) test('prop "onBlur"', (done) => {