-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-no-blocker.js
29 lines (27 loc) · 1.05 KB
/
test-no-blocker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* eslint-env mocha,jquery */
/* global expect,AdblockDetector */
describe("AdblockDetector - No Ad Blocker", function() {
"use strict";
describe(".detect()", function() {
it("should detect no ads when no ad-blocker is running", function(done) {
AdblockDetector.detect({
timeout: 1500,
blocked: function() {
expect().fail("blocked callback should never fire");
},
complete: function(adCount, adsBlockedCount) {
expect(adCount).to.equal(2, "2 ads detected");
expect(adsBlockedCount).to.equal(0, "0 ads blocked");
done();
}
});
});
});
describe("hasAdsBlocked()", function() {
it("should return false when no ad-blocker is running", function() {
$(".ad-container").each(function(i, element) {
expect(AdblockDetector.hasAdsBlocked(element)).to.not.be.ok();
});
});
});
});