File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 113113 } ) ;
114114 } ) ;
115115
116+ QUnit . test ( "Added domains get cookieblocked" , ( assert ) => {
117+ const DOMAIN = "example.com" ;
118+
119+ let done = assert . async ( ) ;
120+ assert . expect ( 2 ) ;
121+
122+ // mark domain for blocking
123+ badger . storage . setupHeuristicAction ( DOMAIN , constants . BLOCK ) ;
124+
125+ // respond with this domain added
126+ let ylist = get_ylist ( ) ;
127+ ylist [ DOMAIN ] = true ;
128+ server . respondWith ( "GET" , constants . YELLOWLIST_URL ,
129+ [ 200 , { } , Object . keys ( ylist ) . join ( "\n" ) ] ) ;
130+
131+ // update yellowlist
132+ badger . updateYellowlist ( function ( success ) {
133+ assert . ok ( success , "Callback status indicates success" ) ;
134+
135+ // check that the domain got cookieblocked
136+ assert . equal (
137+ badger . storage . getAction ( DOMAIN ) ,
138+ constants . COOKIEBLOCK ,
139+ "domain is marked for blocking"
140+ ) ;
141+
142+ done ( ) ;
143+ } ) ;
144+ } ) ;
145+
116146} ( ) ) ;
You can’t perform that action at this time.
0 commit comments