Index: test/browser/_utils.js |
=================================================================== |
--- a/test/browser/_utils.js |
+++ b/test/browser/_utils.js |
@@ -21,8 +21,34 @@ |
{ |
return new Promise(resolve => |
{ |
setTimeout(resolve, delay); |
}); |
} |
exports.timeout = timeout; |
+ |
+function expectHidden(test, element, id) |
+{ |
Manish Jethani
2019/04/18 08:40:43
I really don't think this is generic enough to kee
hub
2019/04/18 17:48:40
Done.
|
+ let withId = ""; |
+ if (typeof id != "undefined") |
+ withId = ` with ID '${id}'`; |
+ |
+ test.equal( |
+ window.getComputedStyle(element).display, "none", |
+ `The element${withId}'s display property should be set to 'none'`); |
+} |
+ |
+exports.expectHidden = expectHidden; |
+ |
+function expectVisible(test, element, id) |
+{ |
+ let withId = ""; |
+ if (typeof id != "undefined") |
+ withId = ` with ID '${id}'`; |
+ |
+ test.notEqual( |
+ window.getComputedStyle(element).display, "none", |
+ `The element${withId}'s display property should not be set to 'none'`); |
+} |
+ |
+exports.expectVisible = expectVisible; |