From d97edef579e1bb7fa9730c2b446d310c2e284e47 Mon Sep 17 00:00:00 2001 From: Alim TUNC Date: Thu, 3 Aug 2023 18:47:16 +0200 Subject: [PATCH] Remove useless declared function on cypress test crashing tsc --- cypress/e2e/langchain_cb/spec.cy.ts | 25 ++++++++++++------------- cypress/e2e/llama_index_cb/spec.cy.ts | 22 +++++++++------------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/cypress/e2e/langchain_cb/spec.cy.ts b/cypress/e2e/langchain_cb/spec.cy.ts index 224c8222d6..1f0895e66a 100644 --- a/cypress/e2e/langchain_cb/spec.cy.ts +++ b/cypress/e2e/langchain_cb/spec.cy.ts @@ -1,15 +1,3 @@ -function testPlayground(index, shouldContain: string) { - cy.get(".playground-button").eq(index).should("exist").click(); - - cy.get("#playground") - .should("exist") - .get("[contenteditable=true]") - .should("exist") - .should("contain", shouldContain); - - cy.get("#playground").get("#close-playground").should("exist").click(); -} - describe("Langchain Callback", () => { before(() => { cy.intercept("/project/settings").as("settings"); @@ -30,6 +18,17 @@ describe("Langchain Callback", () => { cy.get(".message").should("have.length", 4); - testPlayground(0, "This is prompt of llm1\nThis is the response of tool1"); + cy.get(".playground-button").eq(0).should("exist").click(); + + cy.get("#playground") + .should("exist") + .get("[contenteditable=true]") + .should("exist") + .should( + "contain", + "This is prompt of llm1\nThis is the response of tool1" + ); + + cy.get("#playground").get("#close-playground").should("exist").click(); }); }); diff --git a/cypress/e2e/llama_index_cb/spec.cy.ts b/cypress/e2e/llama_index_cb/spec.cy.ts index 4d5ff88b30..da0c837fc8 100644 --- a/cypress/e2e/llama_index_cb/spec.cy.ts +++ b/cypress/e2e/llama_index_cb/spec.cy.ts @@ -1,15 +1,3 @@ -function testPlayground(index, shouldContain: string) { - cy.get(".playground-button").eq(index).should("exist").click(); - - cy.get("#playground") - .should("exist") - .get("[contenteditable=true]") - .should("exist") - .should("contain", shouldContain); - - cy.get("#playground").get("#close-playground").should("exist").click(); -} - describe("Llama Index Callback", () => { before(() => { cy.intercept("/project/settings").as("settings"); @@ -32,6 +20,14 @@ describe("Llama Index Callback", () => { .eq(0) .should("contain", "Source 0"); - testPlayground(0, "This is the LLM prompt\nThis is the LLM response"); + cy.get(".playground-button").eq(0).should("exist").click(); + + cy.get("#playground") + .should("exist") + .get("[contenteditable=true]") + .should("exist") + .should("contain", "This is the LLM prompt\nThis is the LLM response"); + + cy.get("#playground").get("#close-playground").should("exist").click(); }); });