Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
fix: use new api for voting
Browse files Browse the repository at this point in the history
  • Loading branch information
KillWolfVlad committed Nov 18, 2023
1 parent 324961c commit 1575276
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions upvote.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ describe("Upvote", () => {
const formData = new FormData();

formData.append("csrf_token", csrfToken);
formData.append("ts", new Date().getTime());
formData.append("showVotingOptions", "true");

const toggleUpvoteResult = await fetch(
const toggleUpvoteResponse = await fetch(
`https://feedback.gitkraken.com/s/${encodeURIComponent(
feedbackId
)}/toggleupvote`,
)}/vote`,
{
method: "POST",
body: formData,
Expand All @@ -42,9 +42,13 @@ describe("Upvote", () => {
},
signal: AbortSignal.timeout(60_000),
}
).then((response) => response.text());
);

assert.strictEqual(toggleUpvoteResult, "OK");
assert.strictEqual(
toggleUpvoteResponse.status,
200,
"voting must be successfully"
);
});
}
});

0 comments on commit 1575276

Please sign in to comment.