Skip to content

Commit

Permalink
test(parse): add test coverage when no copilot_confirmations present (#…
Browse files Browse the repository at this point in the history
…100)

<!--
This pull request template provides suggested sections for framing your
work.
You're welcome to change or remove headers if it doesn't fit your use
case. :)
-->

### What are you trying to accomplish?
Improve test coverage for `parse.js` file. Concretely for
`getUserConfirmation()` method.

relates to
#87
  • Loading branch information
oscard0m authored Sep 18, 2024
1 parent 995b72d commit bcf306b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions test/parse.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test("verifyAndParseRequest()", async (t) => {
"content-type": "application/json",
"x-request-id": "<request-id>",
},
},
}
);
const testRequest = defaultRequest.defaults({
request: { fetch: fetchMock },
Expand Down Expand Up @@ -132,6 +132,21 @@ test("getUserConfirmation()", (t) => {
id: "some-confirmation-id",
metadata: { someConfirmationMetadata: "value" },
},
result,
result
);
});

test("getUserConfirmation() with no copilot confirmations", (t) => {
const payload = {
messages: [
{
content: "Some previous message",
},
{
content: "Hello, world!",
},
],
};
const result = getUserConfirmation(payload);
t.deepEqual(undefined, result);
});

0 comments on commit bcf306b

Please sign in to comment.