File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,22 @@ QUnit.test('false secure value', function (assert) {
192192 assert . strictEqual ( actual , expected , 'false should not modify path in cookie string' ) ;
193193} ) ;
194194
195+ QUnit . test ( 'undefined attribute value' , function ( assert ) {
196+ assert . expect ( 4 ) ;
197+ assert . strictEqual ( Cookies . set ( 'c' , 'v' , {
198+ expires : undefined
199+ } ) , 'c=v; path=/' , 'should not write undefined expires attribute' ) ;
200+ assert . strictEqual ( Cookies . set ( 'c' , 'v' , {
201+ path : undefined
202+ } ) , 'c=v' , 'should not write undefined path attribute' ) ;
203+ assert . strictEqual ( Cookies . set ( 'c' , 'v' , {
204+ domain : undefined
205+ } ) , 'c=v; path=/' , 'should not write undefined domain attribute' ) ;
206+ assert . strictEqual ( Cookies . set ( 'c' , 'v' , {
207+ secure : undefined
208+ } ) , 'c=v; path=/' , 'should not write undefined secure attribute' ) ;
209+ } ) ;
210+
195211QUnit . module ( 'remove' , lifecycle ) ;
196212
197213QUnit . test ( 'deletion' , function ( assert ) {
You can’t perform that action at this time.
0 commit comments