From 659865d31bb095a32888f9a8bcd0a09f41bbcba6 Mon Sep 17 00:00:00 2001 From: Thomas Gamble Date: Tue, 5 Apr 2016 22:10:41 -0700 Subject: [PATCH 1/2] cleaned up package.json --- package.json | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 36bed0fd..51e137c3 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,9 @@ "style-loader": "^0.13.0", "url-loader": "^0.5.7", "webpack": "^1.12.14", - "webpack-babel-jest": "^1.0.4" + "webpack-babel-jest": "^1.0.4", + "jasmine": "^2.4.1", + "jest": "^0.1.40" }, "scripts": { "test": "jest", @@ -61,9 +63,5 @@ "bugs": { "url": "https://github.com/krujos/willitconnect/issues" }, - "homepage": "https://github.com/krujos/willitconnect#readme", - "devDependencies": { - "jasmine": "^2.4.1", - "jest": "^0.1.40" - } + "homepage": "https://github.com/krujos/willitconnect#readme" } From 45834e4d99c2d0f9fc5f171cb6096ae709811623 Mon Sep 17 00:00:00 2001 From: Thomas Gamble Date: Tue, 5 Apr 2016 22:22:49 -0700 Subject: [PATCH 2/2] readme and mixpanel cleanup --- README.md | 5 ++--- src/main/resources/static/scripts/Entry.js | 7 ++++++- src/main/resources/static/scripts/EntryForm.js | 1 + .../resources/static/scripts/__test__/EntryFormTest.js | 6 +++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c513fe60..1c9dea67 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ -[![Stories in Ready](https://badge.waffle.io/krujos/willitconnect.png?label=ready&title=Ready)](https://waffle.io/krujos/willitconnect) + Will It Connect? ================ [![wercker status](https://app.wercker.com/status/95669acf2b99f3b76662dd01e0696d37/m "wercker status")](https://app.wercker.com/project/bykey/95669acf2b99f3b76662dd01e0696d37) +[![Stories in Ready](https://badge.waffle.io/krujos/willitconnect.png?label=ready&title=Ready)](https://waffle.io/krujos/willitconnect) Sometimes, you just want to know if you can reach your thing (service really) from Cloud Foundry. Is there a proxy in the way, is there an app security @@ -151,6 +152,4 @@ You can run it locally by using ➜ ./gradlew bootRun ``` -#TODO -* improve test coverage for UI diff --git a/src/main/resources/static/scripts/Entry.js b/src/main/resources/static/scripts/Entry.js index 4acb8d97..f0ab494f 100644 --- a/src/main/resources/static/scripts/Entry.js +++ b/src/main/resources/static/scripts/Entry.js @@ -14,7 +14,9 @@ var Entry = React.createClass({ return JSON.stringify({"target": this.props.host+":"+this.props.port}); }, successFunc: function(data){ - mixpanel.track("connection attempted", {"canConnect":data.canConnect}); + mixpanel.track("connection attempted", { "canConnect": data.canConnect, + "httpStatus": data.httpStatus, "validHostName":data.validHostName, + "validUrl":data.validUrl}); this.setState({status: data}); }, componentWillMount: function () { @@ -37,6 +39,9 @@ var Entry = React.createClass({ if(Object.keys(this.state.status).length) { connectionStyle = this.state.status.canConnect ? {color: 'green'} : {color: 'red'}; + if(this.state.status.statusCode) { + resultString += " statusCode - " + this.state.status.statusCode; + } } return ( diff --git a/src/main/resources/static/scripts/EntryForm.js b/src/main/resources/static/scripts/EntryForm.js index 8e71057f..7f1b5400 100644 --- a/src/main/resources/static/scripts/EntryForm.js +++ b/src/main/resources/static/scripts/EntryForm.js @@ -26,6 +26,7 @@ var EntryForm = React.createClass({ } if(this.state.isChecked) { + mixpanel.track("connect attempted with proxy"); proxyHost = this.refs.proxyHost.getValue(); proxyPort = this.refs.proxyPort.getValue(); } diff --git a/src/main/resources/static/scripts/__test__/EntryFormTest.js b/src/main/resources/static/scripts/__test__/EntryFormTest.js index b7680738..29ad00ab 100644 --- a/src/main/resources/static/scripts/__test__/EntryFormTest.js +++ b/src/main/resources/static/scripts/__test__/EntryFormTest.js @@ -11,10 +11,14 @@ describe('EntryForm', () => { var entryForm, renderedEntryForm; + var mixpanel = { + track: function () {} + }; + beforeEach(function() { + window.mixpanel = mixpanel; entryForm = TestUtils.renderIntoDocument(); renderedEntryForm = ReactDOM.findDOMNode(entryForm); - }); it("displays the form", function() {