Skip to content

Commit

Permalink
removing fixture for conversation continued test
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio Colajanni committed Jul 9, 2024
1 parent d7345b5 commit b84a2a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 41 deletions.
22 changes: 8 additions & 14 deletions cypress/e2e/prevConvesations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,32 +54,26 @@ describe("Previous Conversations", () => {
});
});

it("is possible to continue a previous conversation", () => {
it("should be possible to continue a previous conversation", () => {
cy.session("default2", () => {
const localOptions = {
userId: `user-1`,
sessionId: `session-1`,
channel: `channel-1`,
};

const key = [
"channel-1",
"user-1",
"session-1",
"5e51fcdc2c10fe4c5267c8a798a7134086f60b62998062af620ed73b096e25bd",
];

cy.window().then(window => {
window.localStorage.clear();
cy.fixture("prevConversations.json").then(jsonData => {
window.localStorage.setItem(JSON.stringify(key), JSON.stringify(jsonData));
});
});

cy.visitWebchat();
cy.initWebchat(localOptions).openWebchat();
cy.initWebchat(localOptions).openWebchat().startConversation();
cy.sendMessage("hello");
cy.contains('You said "hello".').should("be.visible");

// list contains 1 item
cy.get("button.webchat-header-back-button").should("exist").click();
cy.get("button").contains("Previous conversations").click();
cy.get(".webchat-prev-conversations-content").should("exist");
cy.get(".webchat-prev-conversations-item").should("have.length", 1);

// go to the first conversation
Expand All @@ -90,7 +84,7 @@ describe("Previous Conversations", () => {
});
});

it("is not possible to continue expired previous conversation", () => {
it("should not be possible to continue expired previous conversation", () => {
cy.session("default3", () => {
const localOptions = {
userId: `user-1`,
Expand Down
27 changes: 0 additions & 27 deletions cypress/fixtures/prevConversations.json

This file was deleted.

0 comments on commit b84a2a7

Please sign in to comment.