Skip to content

Commit

Permalink
Merge branch 'main' of github.com:nightwatchjs/nightwatch
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Sep 11, 2022
2 parents dc06601 + 6971bf5 commit f672df2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
10 changes: 1 addition & 9 deletions lib/api/expect/cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,7 @@ class ExpectCookie extends BaseExpect {
if (!result.value) {
return this.reject(new NotFoundError(`no cookie "${this.cookieName}"${domainStr} was found`));
}
if (result && result.value) {
if (Array.isArray(result.value)) {
this.resultValue = result.value.length > 0 ? result.value[0].value : null;
} else {
this.resultValue = result.value.value;
}
} else {
this.resultValue = {};
}
this.resultValue = result ? result.value : {};

return this.resolve(this.resultValue);
})
Expand Down
12 changes: 5 additions & 7 deletions test/lib/nocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,11 @@ module.exports = {
.reply(200, {
status: 0,
state: 'success',
value: [
{
domain: 'cookie-domain',
name: name,
value: value
}
]
value : {
domain: 'cookie-domain',
name: name,
value: value
}
});

return this;
Expand Down

0 comments on commit f672df2

Please sign in to comment.