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

Side by Side Diff: qunit/tests/filterValidation.js

Issue 29592604: Issue 5957 - Get the unit tests passing again (Closed)
Patch Set: Created Oct. 30, 2017, 2:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « qunit/tests/cssEscaping.js ('k') | qunit/tests/prefs.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 "use strict"; 1 "use strict";
2 2
3 { 3 {
4 const {parseFilter, parseFilters} = require("filterValidation"); 4 const {parseFilter, parseFilters} = require("filterValidation");
5 const {BlockingFilter, 5 const {BlockingFilter,
6 ElemHideFilter, 6 ElemHideFilter,
7 CommentFilter} = require("filterClasses"); 7 CommentFilter} = require("filterClasses");
8 8
9 module("Filter validation"); 9 QUnit.module("Filter validation");
10 10
11 test("Detecting invalid filters", () => 11 test("Detecting invalid filters", () =>
12 { 12 {
13 equal(parseFilter("||example.com^$unknown").error.type, "invalid-filter", 13 equal(parseFilter("||example.com^$unknown").error.type, "invalid-filter",
14 "unknown option"); 14 "unknown option");
15 equal(parseFilter("[foobar]").error.type, "unexpected-filter-list-header", 15 equal(parseFilter("[foobar]").error.type, "unexpected-filter-list-header",
16 "filter list header"); 16 "filter list header");
17 equal(parseFilter("##[foo").error.type, "invalid-css-selector", 17 equal(parseFilter("##[foo").error.type, "invalid-css-selector",
18 "invalid selector"); 18 "invalid selector");
19 ok( 19 ok(
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 ok(result.filters[0] instanceof BlockingFilter, "1st filter is blocking"); 64 ok(result.filters[0] instanceof BlockingFilter, "1st filter is blocking");
65 equal(result.filters[0].text, "||example.com^", "1st filter text matches"); 65 equal(result.filters[0].text, "||example.com^", "1st filter text matches");
66 66
67 ok(result.filters[1] instanceof ElemHideFilter, "2nd filter is elemhide"); 67 ok(result.filters[1] instanceof ElemHideFilter, "2nd filter is elemhide");
68 equal(result.filters[1].text, "###foobar", "2nd filter text matches"); 68 equal(result.filters[1].text, "###foobar", "2nd filter text matches");
69 69
70 ok(result.filters[2] instanceof CommentFilter, "3rd filter is comment"); 70 ok(result.filters[2] instanceof CommentFilter, "3rd filter is comment");
71 equal(result.filters[2].text, "! foo bar", "3rd filter text matches"); 71 equal(result.filters[2].text, "! foo bar", "3rd filter text matches");
72 }); 72 });
73 } 73 }
OLDNEW
« no previous file with comments | « qunit/tests/cssEscaping.js ('k') | qunit/tests/prefs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld