Skip to content

Commit

Permalink
Merge pull request #27 from hinthealth/chore/dependencies
Browse files Browse the repository at this point in the history
update dependencies
  • Loading branch information
EpiphanyMachine authored Oct 15, 2016
2 parents d71d59d + b218cea commit 6b305b9
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "behave",
"version": "0.1.9",
"version": "0.2.0",
"authors": [
"Blake West <[email protected]>",
"Gregory Hilkert <[email protected]>"
Expand All @@ -26,7 +26,7 @@
"tests"
],
"dependencies": {
"jquery": "~2.0.3",
"lodash": "^2.4.1"
"jquery": "~3.1.1",
"lodash": "^4.16.4"
}
}
6 changes: 3 additions & 3 deletions dist/behave.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ var tryToFind = function(expression) {
catch (e) {
// Syntax errors occur sometimes when trying to do certain operations
// with ~'s and such. We just want it to return nothing in this case.
if ( !(_.contains(e.message, "Syntax error") || _.contains(e.message, "SyntaxError")) ) {
if ( !(_.includes(e.message, "Syntax error") || _.includes(e.message, "SyntaxError")) ) {
// Re throw if it's not a syntax errors
throw (e)
}
Expand All @@ -192,7 +192,7 @@ var getClosestInput = function($el) {
};

var findByClass = function(identifier, elType) {
var prefix = _.contains(['icon', 'div', 'span'], elType) ? 'glyphicon-' : '';
var prefix = _.includes(['icon', 'div', 'span'], elType) ? 'glyphicon-' : '';
elType = elType || '';
var expression = elType + '.' + prefix + identifier;

Expand All @@ -219,7 +219,7 @@ var cleanVal = function(val) {
// Remove any spaces.
val = val.replace(' ', '');

if (_.contains(val, '-')) {
if (_.includes(val, '-')) {
// camelCasing attrs with dashes in them.
var words = val.split('-');
words[1] = words[1][0].toUpperCase() + words[1].substring(1);
Expand Down
2 changes: 1 addition & 1 deletion dist/behave.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "behave",
"version": "0.1.9",
"version": "0.2.0",
"description": "Front end testing helpers!",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/behave.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ var tryToFind = function(expression) {
catch (e) {
// Syntax errors occur sometimes when trying to do certain operations
// with ~'s and such. We just want it to return nothing in this case.
if ( !(_.contains(e.message, "Syntax error") || _.contains(e.message, "SyntaxError")) ) {
if ( !(_.includes(e.message, "Syntax error") || _.includes(e.message, "SyntaxError")) ) {
// Re throw if it's not a syntax errors
throw (e)
}
Expand All @@ -192,7 +192,7 @@ var getClosestInput = function($el) {
};

var findByClass = function(identifier, elType) {
var prefix = _.contains(['icon', 'div', 'span'], elType) ? 'glyphicon-' : '';
var prefix = _.includes(['icon', 'div', 'span'], elType) ? 'glyphicon-' : '';
elType = elType || '';
var expression = elType + '.' + prefix + identifier;

Expand All @@ -219,7 +219,7 @@ var cleanVal = function(val) {
// Remove any spaces.
val = val.replace(' ', '');

if (_.contains(val, '-')) {
if (_.includes(val, '-')) {
// camelCasing attrs with dashes in them.
var words = val.split('-');
words[1] = words[1][0].toUpperCase() + words[1].substring(1);
Expand Down
36 changes: 18 additions & 18 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@
var jqResult = $view.find("a:contains('Back to All Invoices')");
var bResultNotExact = Behave.tryFind("Back to All");
var bResultExact = Behave.find("Back to All Invoices");
bResultExact.text().should == "Back to All Invoices";
bResultExact.text().should.containEql("Back to All Invoices");
bResultExact.text().should.eql(jqResult.text());
bResultNotExact.text().should.eql('');
});
});
describe("when using rough match", function() {
beforeEach(function() {
Behave.view.append("<div>Success: This is alert text that could be many things!</div>")
Behave.view.append("<div>Success: This is alert text that could be many things!</div>");
});
it("should find a substring match", function() {
var bResult = Behave.find('~Success');
Expand All @@ -105,7 +105,7 @@
$view.append("<button>Subdomain</button>");
$view.append("<a href='www.test.com'>Practice Url</button>");
jqResult = $view.find('button:contains(Subdomain)');
})
});
it("should find only clickable type elements and search by containing text", function() {
bResult = Behave.find('Subdomain', 'clickable');
bResult.is('input').should.eql(false);
Expand All @@ -125,8 +125,8 @@
});
describe("with icon type elements", function() {
beforeEach(function() {
$view.append("<span class='glyphicon glyphicon-cancel'></span>")
$view.append("<icon type='danger'></icon>")
$view.append("<span class='glyphicon glyphicon-cancel'></span>");
$view.append("<icon type='danger'></icon>");
});
it("find icons by type", function() {
Behave.find('danger', 'icon').attr('type').should.eql('danger');
Expand All @@ -137,8 +137,8 @@
});
describe("when passing jQuery type selectors", function() {
beforeEach(function() {
$view.append("<div id='someId'>Worked!</div>")
$view.append("<div class='someclass'>Worked!</div>")
$view.append("<div id='someId'>Worked!</div>");
$view.append("<div class='someclass'>Worked!</div>");
});
it("should use jQuery if it can't find it normally", function() {
Behave.find('#someId').text().should.eql('Worked!');
Expand All @@ -152,18 +152,18 @@
});
describe("using #with", function() {
beforeEach(function() {
var form = $("<form type='form'></form>")
form.append("<input type='checkbox' name='accept_terms'>")
form.append("<input type='text' name='first_name'>")
form.append("<label for='practice_url'>Practice Url</label>")
form.append("<input type='text' name='practice_url'>")
$view.append(form)
var form = $("<form type='form'></form>");
form.append("<input type='checkbox' name='accept_terms'>");
form.append("<input type='text' name='first_name'>");
form.append("<label for='practice_url'>Practice Url</label>");
form.append("<input type='text' name='practice_url'>");
$view.append(form);
});
describe('on individual form elements', function() {
it("should fill in the element with the provided data", function() {
Behave.fill('testPlaceholder').with('bananas');
Behave.find('testPlaceholder').val().should.eql('bananas');
})
});
it("should work with checkboxes", function() {
Behave.find('accept_terms').prop('checked').should.be.false
Behave.fill('accept_terms').with(true);
Expand All @@ -178,11 +178,11 @@
'Practice Url': 'www.yesthisworked.com'
});
Behave.find('accept_terms').prop('checked').should.be.true
Behave.find('first_name').val().should.eql('Joe Shmo')
Behave.find('Practice Url').val().should.eql('www.yesthisworked.com')
})
Behave.find('first_name').val().should.eql('Joe Shmo');
Behave.find('Practice Url').val().should.eql('www.yesthisworked.com');
});
});
})
});
});
xdescribe("#click", function() {
it("would be annoying to test, but I manually tested this");
Expand Down
2 changes: 1 addition & 1 deletion test/testRunner.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div id="mocha"></div>
<script src="../node_modules/should/should.min.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../bower_components/jquery/jquery.min.js"></script>
<script src="../bower_components/jquery/dist/jquery.min.js"></script>
<script src="../bower_components/lodash/dist/lodash.min.js"></script>
<script src="templates.js"></script>
<script src="../src/behave.js"></script>
Expand Down

0 comments on commit 6b305b9

Please sign in to comment.