From f6a15190f36f64c7efa769fcaf6619eac7275c3f Mon Sep 17 00:00:00 2001 From: Sefa Ilkimen Date: Thu, 4 Jan 2018 13:17:52 +0100 Subject: [PATCH] add another cookie spec to validate #59 --- test/app-test-definitions.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/app-test-definitions.js b/test/app-test-definitions.js index c14f394..1c687a3 100644 --- a/test/app-test-definitions.js +++ b/test/app-test-definitions.js @@ -331,6 +331,25 @@ const tests = [ .Cookie .should.be.equal('myCookie=myValue; mySecondCookie=mySecondValue'); } + },{ + description: 'should not send any cookies after running "clearCookies" (GET) #59', + expected: 'resolved: {"status": 200, "data": "{\"headers\": {\"Cookie\": \"\"...', + func: function(resolve, reject) { + cordova.plugin.http.setCookie('http://httpbin.org/get', 'myCookie=myValue'); + cordova.plugin.http.setCookie('http://httpbin.org/get', 'mySecondCookie=mySecondValue'); + cordova.plugin.http.clearCookies(); + cordova.plugin.http.get('http://httpbin.org/get', {}, {}, resolve, reject); + }, + validationFunc: function(driver, result) { + result.type.should.be.equal('resolved'); + result.data.data.should.be.a('string'); + + JSON + .parse(result.data.data) + .headers + .Cookie + .should.be.equal(''); + } },{ description: 'should send programmatically set cookies correctly (DOWNLOAD) #57', expected: 'resolved: {"content":{"cookies":{"myCookie":"myValue ...',