Skip to content

Commit

Permalink
Remove useless declared function on cypress test crashing tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
alimtunc committed Aug 7, 2023
1 parent 8990c72 commit d97edef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 26 deletions.
25 changes: 12 additions & 13 deletions cypress/e2e/langchain_cb/spec.cy.ts
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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();
});
});
22 changes: 9 additions & 13 deletions cypress/e2e/llama_index_cb/spec.cy.ts
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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();
});
});

0 comments on commit d97edef

Please sign in to comment.