Index: test/filterClasses.js |
=================================================================== |
--- a/test/filterClasses.js |
+++ b/test/filterClasses.js |
@@ -466,8 +466,28 @@ |
checkNotifications(() => |
{ |
filter.hitCount = 0; |
}, ["filter.hitCount", "foobar"], "Resetting filter hit counts"); |
filter.delete(); |
test.done(); |
}; |
+ |
+exports.testEmptyElemHideDomains = function(test) |
+{ |
+ let emptyDomainFilters = [ |
+ ",##selector", ",,,##selector", "~,foo.com##selector", "foo.com,##selector", |
+ ",foo.com##selector", "foo.com,~##selector", |
+ "foo.com,,bar.com##selector", "foo.com,~,bar.com##selector" |
+ ]; |
+ |
+ for (let filterText of emptyDomainFilters) |
+ { |
+ withNAD(0, filter => |
+ { |
+ test.ok(filter instanceof InvalidFilter); |
+ test.equal(filter.reason, "filter_invalid_domain"); |
+ })(Filter.fromText(filterText)); |
+ } |
+ |
+ test.done(); |
+}; |