Skip to content

Commit

Permalink
isValidSignalIAB test (issue #392)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophieeng committed Jan 3, 2023
1 parent d773db4 commit 1ce9d7e
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions test/background/isValidSignalIAB.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
import assert from 'assert';
import {isValidSignalIAB} from '../../src/background/cookiesIAB.js';

it('should accept 1--- as true string', () => {
assert.equal(isValidSignalIAB("1---"), true);
describe('Check different IAB signals for validity', () => {
it('should accept 1--- as true string', () => {
assert.equal(isValidSignalIAB("1---"), true);
});
it('should accept 1YNY as true string', () => {
assert.equal(isValidSignalIAB("1YNY"), true);
});
it('should reject 1-- as false string', () => {
assert.equal(isValidSignalIAB("1--"), false);
});
it('should reject 2YYY as false string', () => {
assert.equal(isValidSignalIAB("2YYY"), false);
});
it('should reject 1WWW as false string', () => {
assert.equal(isValidSignalIAB("1WWW"), false);
});

});

0 comments on commit 1ce9d7e

Please sign in to comment.