mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-04-24 00:00:03 +08:00
test: implement e2e test for #248
This commit is contained in:
+21
-1
@@ -464,7 +464,7 @@ const tests = [
|
||||
}
|
||||
},
|
||||
{
|
||||
description: 'should not send any cookies after running "clearCookies" (GET) #59',
|
||||
description: 'should not send programmatically set 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');
|
||||
@@ -946,6 +946,26 @@ const tests = [
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
only: true,
|
||||
description: 'should not send any cookies after running "clearCookies" (GET) #248',
|
||||
expected: 'resolved: {"status": 200, "data": "{\"cookies\":{}} ...',
|
||||
before: helpers.disableFollowingRedirect,
|
||||
func: function (resolve, reject) {
|
||||
cordova.plugin.http.get('https://httpbin.org/cookies/set?myCookieKey=myCookieValue', {}, {}, function() {
|
||||
cordova.plugin.http.clearCookies();
|
||||
cordova.plugin.http.get('https://httpbin.org/cookies', {}, {}, resolve, reject);
|
||||
}, function() {
|
||||
cordova.plugin.http.clearCookies();
|
||||
cordova.plugin.http.get('https://httpbin.org/cookies', {}, {}, resolve, reject);
|
||||
});
|
||||
},
|
||||
validationFunc: function (driver, result) {
|
||||
result.type.should.be.equal('resolved');
|
||||
result.data.status.should.be.equal(200);
|
||||
JSON.parse(result.data.data).cookies.should.be.eql({});
|
||||
}
|
||||
},
|
||||
|
||||
// TODO: not ready yet
|
||||
// {
|
||||
|
||||
Reference in New Issue
Block a user