Skip to content

Commit

Permalink
Test yellowlist additions getting cookieblocked.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostwords committed Oct 4, 2017
1 parent b003df5 commit 372c009
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/tests/tests/yellowlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,34 @@
});
});

QUnit.test("Added domains get cookieblocked", (assert) => {
const DOMAIN = "example.com";

let done = assert.async();
assert.expect(2);

// mark domain for blocking
badger.storage.setupHeuristicAction(DOMAIN, constants.BLOCK);

// respond with this domain added
let ylist = get_ylist();
ylist[DOMAIN] = true;
server.respondWith("GET", constants.YELLOWLIST_URL,
[200, {}, Object.keys(ylist).join("\n")]);

// update yellowlist
badger.updateYellowlist(function (success) {
assert.ok(success, "Callback status indicates success");

// check that the domain got cookieblocked
assert.equal(
badger.storage.getAction(DOMAIN),
constants.COOKIEBLOCK,
"domain is marked for blocking"
);

done();
});
});

}());

0 comments on commit 372c009

Please sign in to comment.