From b623587aab6db3f837b67bf2b70a215a3292f979 Mon Sep 17 00:00:00 2001 From: Eli Sherer Date: Thu, 31 Aug 2017 18:54:28 +0300 Subject: [PATCH] test passing a different type than text to input props, fix constructor of ResizableInput --- package.json | 2 +- src/ResizableInput.ls | 4 +++- test/common-tests.ls | 8 +++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 40a73f8..7689e2b 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "gulp", "test": "mocha test/index.ls --compilers ls:livescript", - "coverage": "istanbul cover _mocha -- test/index.ls --require should --compilers ls:livescript", + "coverage": "istanbul cover node_modules/mocha/bin/_mocha -- test/index.ls --require should --compilers ls:livescript", "coveralls": "istanbul cover _mocha -- test/index.ls --require should --compilers ls:livescript && cat coverage/lcov.info | coveralls" }, "author": "Furqan Zafar", diff --git a/src/ResizableInput.ls b/src/ResizableInput.ls index 4a3c2d6..641c73d 100644 --- a/src/ResizableInput.ls +++ b/src/ResizableInput.ls @@ -9,7 +9,9 @@ module.exports = class ResizableInput extends React.PureComponent @default-props = type: \text - constructor: -> + # constructor + (props) -> + super props @autosize = @autosize.bind @ @focus = @focus.bind @ @blur = @blur.bind @ diff --git a/test/common-tests.ls b/test/common-tests.ls index a048cef..ca79440 100644 --- a/test/common-tests.ls +++ b/test/common-tests.ls @@ -388,8 +388,14 @@ module.exports = (select-class) !-> click-option find-highlighted-option select component-with-class-must-not-exist select, \react-selectize-reset-button-container + specify "must use text as default type of search field", -> + select = create-select! + input = get-input select + assert input.type == \text + specify "must pass props.inputProps to search field", -> select = create-select do - input-props: disabled: true + input-props: { disabled: true, type: \tel } input = get-input select assert input.disabled == true + assert input.type == \tel