ember-cli-test-helpers
Advanced tools
Comparing version 0.2.0 to 0.2.1
import Ember from "ember"; | ||
import { assert } from "qunit"; | ||
import QUnit from "qunit"; | ||
var assertElement = function(selector, type, count) { | ||
var element = find(selector); | ||
assert.equal(element.length, count || 1, "element with selector '" + selector + "' not found"); | ||
assert.equal(element.attr("type"), type); | ||
QUnit.assert.equal(element.length, count || 1, "element with selector '" + selector + "' not found"); | ||
QUnit.assert.equal(element.attr("type"), type); | ||
return element; | ||
@@ -13,3 +13,3 @@ }; | ||
var element = find(selector); | ||
assert.equal(element.hasClass("hidden"), false); | ||
QUnit.assert.equal(element.hasClass("hidden"), false); | ||
}; | ||
@@ -19,3 +19,3 @@ | ||
var element = find(selector); | ||
assert.equal(element.hasClass("hidden"), true); | ||
QUnit.assert.equal(element.hasClass("hidden"), true); | ||
}; | ||
@@ -45,3 +45,3 @@ | ||
var element = assertElement("input[name=%@]".fmt(name), "hidden"); | ||
assert.equal(element.val(), value, "value of '" + value + "' is not equal to the element's value of '" + element.val() + "'"); | ||
QUnit.assert.equal(element.val(), value, "value of '" + value + "' is not equal to the element's value of '" + element.val() + "'"); | ||
}; | ||
@@ -60,3 +60,3 @@ | ||
var element = assertElement(selector, _type); | ||
assert.equal(element.text(), text); | ||
QUnit.assert.equal(element.text(), text); | ||
}; | ||
@@ -69,8 +69,8 @@ | ||
assert.equal(control.length, 1, "Unable to find radio button for selector " + selector); | ||
assert.equal(control.attr("type"), "radio", "Element for selector " + selector + " is not a radio button; type is " + control.attr("type")); | ||
assert.ok(control.attr("id"), "Radio button for selector " + selector + " has no id attribute, so it cannot be referred to by a label 'for' attribute"); | ||
QUnit.assert.equal(control.length, 1, "Unable to find radio button for selector " + selector); | ||
QUnit.assert.equal(control.attr("type"), "radio", "Element for selector " + selector + " is not a radio button; type is " + control.attr("type")); | ||
QUnit.assert.ok(control.attr("id"), "Radio button for selector " + selector + " has no id attribute, so it cannot be referred to by a label 'for' attribute"); | ||
assert.equal(label.length, 1, "Unable to find label with 'for' attribute of the selector given for the radio button, " + controlId); | ||
assert.equal(label.text(), text); | ||
QUnit.assert.equal(label.length, 1, "Unable to find label with 'for' attribute of the selector given for the radio button, " + controlId); | ||
QUnit.assert.equal(label.text(), text); | ||
}; | ||
@@ -84,7 +84,7 @@ | ||
var element = find(selector); | ||
assert.equal(element.length, 1); | ||
assert.equal(element.text(), text); | ||
QUnit.assert.equal(element.length, 1); | ||
QUnit.assert.equal(element.text(), text); | ||
if (href) { | ||
assert.equal(element.attr("href"), href); | ||
QUnit.assert.equal(element.attr("href"), href); | ||
} | ||
@@ -107,3 +107,3 @@ }; | ||
if (focused.is(expected)) { | ||
assert.ok(true); | ||
QUnit.assert.ok(true); | ||
} else { | ||
@@ -117,3 +117,3 @@ var tagName = focused.prop("tagName").toLowerCase(); | ||
assert.equal(focused.filter(selector).length, 1, "Expected " + selector + " to have focus, but " + tagName + " has focus"); | ||
QUnit.assert.equal(focused.filter(selector).length, 1, "Expected " + selector + " to have focus, but " + tagName + " has focus"); | ||
} | ||
@@ -120,0 +120,0 @@ } |
{ | ||
"name": "ember-cli-test-helpers", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "A collection of test helpers for ember web applications", | ||
"scripts": { | ||
"start": "ember server", | ||
"build": "ember build" | ||
"build": "ember build", | ||
"test": "ember test" | ||
}, | ||
@@ -9,0 +10,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
49164336
293
571634
9