Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/elemHideEmulation.js

Issue 29685638: Noissue - Check the values of the selector list returned in tests (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Jan. 31, 2018, 8:49 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/elemHideEmulation.js
===================================================================
--- a/test/elemHideEmulation.js
+++ b/test/elemHideEmulation.js
@@ -82,54 +82,84 @@
})(elemHide.getSelectorsForDomain("example.com", 0));
withNAD(0, filter3 =>
{
elemHide.add(filter3);
withNAD(
0, selectors =>
- test.equal(selectors.selectorCount, 3))(
+ {
+ test.equal(selectors.selectorCount, 3);
+ test.equal(selectors.selectorAt(0), "#ads");
+ test.equal(selectors.selectorAt(1), ".message");
+ test.equal(selectors.selectorAt(2), ".foo");
+ })(
elemHide.getSelectorsForDomain("example.com", 0));
withNAD(
0, selectors =>
- test.equal(selectors.selectorCount, 3))(
+ {
+ test.equal(selectors.selectorCount, 3);
+ test.equal(selectors.selectorAt(0), "#ads");
+ test.equal(selectors.selectorAt(1), ".message");
+ test.equal(selectors.selectorAt(2), ".foo");
+ })(
elemHide.getSelectorsForDomain("mail.example.com", 0));
withNAD(0, filter4 =>
{
elemHide.add(filter4);
withNAD(
0, selectors =>
- test.equal(selectors.selectorCount, 3))(
+ {
+ test.equal(selectors.selectorCount, 3);
+ test.equal(selectors.selectorAt(0), "#ads");
+ test.equal(selectors.selectorAt(1), ".message");
+ test.equal(selectors.selectorAt(2), ".foo");
+ })(
elemHide.getSelectorsForDomain("example.com", 0));
withNAD(
0, selectors =>
- test.equal(selectors.selectorCount, 2))(
+ {
+ test.equal(selectors.selectorCount, 2);
+ test.equal(selectors.selectorAt(0), "#ads");
+ test.equal(selectors.selectorAt(1), ".foo");
+ })(
elemHide.getSelectorsForDomain("mail.example.com", 0));
withNAD(
0,
unconditionals =>
- test.equal(unconditionals.selectorCount, 1))(elemHide.getUnconditionalSelectors());
+ {
+ test.equal(unconditionals.selectorCount, 1);
+ test.equal(unconditionals.selectorAt(0), "#ads");
+ })(elemHide.getUnconditionalSelectors());
elemHide.remove(filter4);
})(Filter.fromText("mail.example.com#@#.message"));
withNAD(
0, selectors =>
- test.equal(selectors.selectorCount, 3))(
- elemHide.getSelectorsForDomain("example.com", 0));
+ {
+ test.equal(selectors.selectorCount, 3);
+ test.equal(selectors.selectorAt(0), "#ads");
+ test.equal(selectors.selectorAt(1), ".message");
+ test.equal(selectors.selectorAt(2), ".foo");
+ })(elemHide.getSelectorsForDomain("example.com", 0));
withNAD(
0, selectors =>
- test.equal(selectors.selectorCount, 3))(
- elemHide.getSelectorsForDomain("mail.example.com", 0));
+ {
+ test.equal(selectors.selectorCount, 3);
+ test.equal(selectors.selectorAt(0), "#ads");
+ test.equal(selectors.selectorAt(1), ".message");
+ test.equal(selectors.selectorAt(2), ".foo");
+ })(elemHide.getSelectorsForDomain("mail.example.com", 0));
elemHide.remove(filter3);
})(Filter.fromText("example.com##.message"));
withNAD(
0, selectors =>
test.equal(selectors.selectorCount, 2))(
elemHide.getSelectorsForDomain("example.com", 0));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld