Skip to content

Commit bcf306b

Browse files
authoredSep 18, 2024
test(parse): add test coverage when no copilot_confirmations present (#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
1 parent 995b72d commit bcf306b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed
 

‎test/parse.test.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ test("verifyAndParseRequest()", async (t) => {
7777
"content-type": "application/json",
7878
"x-request-id": "<request-id>",
7979
},
80-
},
80+
}
8181
);
8282
const testRequest = defaultRequest.defaults({
8383
request: { fetch: fetchMock },
@@ -132,6 +132,21 @@ test("getUserConfirmation()", (t) => {
132132
id: "some-confirmation-id",
133133
metadata: { someConfirmationMetadata: "value" },
134134
},
135-
result,
135+
result
136136
);
137137
});
138+
139+
test("getUserConfirmation() with no copilot confirmations", (t) => {
140+
const payload = {
141+
messages: [
142+
{
143+
content: "Some previous message",
144+
},
145+
{
146+
content: "Hello, world!",
147+
},
148+
],
149+
};
150+
const result = getUserConfirmation(payload);
151+
t.deepEqual(undefined, result);
152+
});

0 commit comments

Comments
 (0)
Failed to load comments.