diff --git a/website/cypress/e2e/create/assistant_reply.cy.ts b/website/cypress/e2e/create/assistant_reply.cy.ts new file mode 100644 index 00000000..aa72b846 --- /dev/null +++ b/website/cypress/e2e/create/assistant_reply.cy.ts @@ -0,0 +1,26 @@ +import { faker } from "@faker-js/faker"; + +describe("replying as the assistant", () => { + it("completes the current task on submit and on request shows a new task", () => { + cy.signInWithEmail("cypress@example.com"); + cy.visit("/create/assistant_reply"); + + cy.get('[data-cy="task-id"').then((taskIdElement) => { + const taskId = taskIdElement.text(); + + const reply = faker.lorem.sentence(); + cy.log("reply", reply); + cy.get('[data-cy="reply"').type(reply); + + cy.get('[data-cy="submit"]').click(); + + cy.get('[data-cy="next-task"]').click(); + + cy.get('[data-cy="task-id"').should((taskIdElement) => { + expect(taskIdElement.text()).not.to.eq(taskId); + }); + }); + }); +}); + +export {}; diff --git a/website/cypress/e2e/create/user_reply.cy.ts b/website/cypress/e2e/create/user_reply.cy.ts new file mode 100644 index 00000000..c126e9c5 --- /dev/null +++ b/website/cypress/e2e/create/user_reply.cy.ts @@ -0,0 +1,26 @@ +import { faker } from "@faker-js/faker"; + +describe("replying as the prompter", () => { + it("completes the current task on submit and on request shows a new task", () => { + cy.signInWithEmail("cypress@example.com"); + cy.visit("/create/user_reply"); + + cy.get('[data-cy="task-id"').then((taskIdElement) => { + const taskId = taskIdElement.text(); + + const reply = faker.lorem.sentence(); + cy.log("reply", reply); + cy.get('[data-cy="reply"').type(reply); + + cy.get('[data-cy="submit"]').click(); + + cy.get('[data-cy="next-task"]').click(); + + cy.get('[data-cy="task-id"').should((taskIdElement) => { + expect(taskIdElement.text()).not.to.eq(taskId); + }); + }); + }); +}); + +export {}; diff --git a/website/src/components/TaskInfo/TaskInfo.tsx b/website/src/components/TaskInfo/TaskInfo.tsx index fa16615e..d32f7d9d 100644 --- a/website/src/components/TaskInfo/TaskInfo.tsx +++ b/website/src/components/TaskInfo/TaskInfo.tsx @@ -2,7 +2,7 @@ export const TaskInfo = ({ id, output }: { id: string; output: string }) => { return (
Given the following conversation, provide an adequate reply
Hint: {task.hint}
} > - +