2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

FIX: user-card tests

This commit is contained in:
Régis Hanol 2015-03-04 13:02:36 +01:00
parent f7c9ee703d
commit 809edd4da3
3 changed files with 17 additions and 6 deletions

View file

@ -1,5 +1,5 @@
/* exported exists, count, present, blank, containsInstance, not */
// Test helpers
/* exported exists, count, present, blank, containsInstance, not, visible */
function exists(selector) {
return !!count(selector);
}
@ -23,3 +23,14 @@ function containsInstance(collection, klass, text) {
function not(state, message) {
ok(!state, message);
}
function visible(selector) {
return find(selector + ":visible").length > 0;
}
function invisible(selector) {
var $items = find(selector + ":visible");
return $items.length === 0 ||
$items.css("opacity") === "0" ||
$items.css("visibility") === "hidden";
}