From f5b49a952ec2b0cf382a4258e62997c2f69df560 Mon Sep 17 00:00:00 2001 From: klotske Date: Thu, 5 Jan 2023 23:46:39 +0300 Subject: [PATCH] Add the taskInteraction contract test --- .../contract/oasst_api_contract_tests.cy.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/website/cypress/contract/oasst_api_contract_tests.cy.ts b/website/cypress/contract/oasst_api_contract_tests.cy.ts index ff5bb156..550fd1dd 100644 --- a/website/cypress/contract/oasst_api_contract_tests.cy.ts +++ b/website/cypress/contract/oasst_api_contract_tests.cy.ts @@ -23,6 +23,27 @@ describe("Contract test for Oasst API", function () { expect(await oasstApiClient.ackTask(task.id, "321")).to.be.null; }); + it("can record a taskInteraction", async () => { + const task = await oasstApiClient.fetchTask("random", { + sub: "test", + name: "test", + email: "test", + }); + expect( + await oasstApiClient.interactTask( + "text_reply_to_message", + task.id, + "1", + { text: "Test" }, + { + sub: "test", + name: "test", + email: "test", + } + ) + ).to.be.not.null; + }); + // TODO(#354): Add test for 204 // TODO(#354): Add test for parsing >=300, throwing an OasstError // TODO(#354): Add test for parsing >=300, throwing a generic error