From c3974f7c81162960268cf10368624e031c40ab73 Mon Sep 17 00:00:00 2001 From: Mika Vilpas Date: Mon, 22 Jul 2024 22:25:22 +0300 Subject: [PATCH] test: add integration test for opening in a new tab (#242) --- .../opening-files.cy.ts | 19 +++++++++++++++++++ .../opening-files.cy.ts | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/integration-tests/cypress/e2e/using-shell-redirection-to-read-events/opening-files.cy.ts b/integration-tests/cypress/e2e/using-shell-redirection-to-read-events/opening-files.cy.ts index 9f70a34..bc79377 100644 --- a/integration-tests/cypress/e2e/using-shell-redirection-to-read-events/opening-files.cy.ts +++ b/integration-tests/cypress/e2e/using-shell-redirection-to-read-events/opening-files.cy.ts @@ -58,6 +58,25 @@ describe("opening files", () => { }) }) + it("can open a file in a new tab", () => { + cy.startNeovim().then((dir) => { + cy.typeIntoTerminal("{upArrow}") + cy.typeIntoTerminal("/test.lua{enter}") + cy.typeIntoTerminal("{control+t}") + + // yazi should now be closed + cy.contains("-- TERMINAL --").should("not.exist") + + cy.contains("defines how to") + cy.typeIntoTerminal(":tabnext{enter}") + + cy.contains("If you see this text, Neovim is ready!") + + cy.contains(dir.contents["test.lua"].name) + cy.contains(dir.contents["initial-file.txt"].name) + }) + }) + it("can send file names to the quickfix list", () => { cy.startNeovim().then((dir) => { cy.typeIntoTerminal("{upArrow}") diff --git a/integration-tests/cypress/e2e/using-ya-to-read-events/opening-files.cy.ts b/integration-tests/cypress/e2e/using-ya-to-read-events/opening-files.cy.ts index 7764870..6cacdb1 100644 --- a/integration-tests/cypress/e2e/using-ya-to-read-events/opening-files.cy.ts +++ b/integration-tests/cypress/e2e/using-ya-to-read-events/opening-files.cy.ts @@ -60,6 +60,25 @@ describe("opening files", () => { }) }) + it("can open a file in a new tab", () => { + startNeovimWithYa().then((dir) => { + cy.typeIntoTerminal("{upArrow}") + cy.typeIntoTerminal("/test.lua{enter}") + cy.typeIntoTerminal("{control+t}") + + // yazi should now be closed + cy.contains("-- TERMINAL --").should("not.exist") + + cy.contains("defines how to") + cy.typeIntoTerminal(":tabnext{enter}") + + cy.contains("If you see this text, Neovim is ready!") + + cy.contains(dir.contents["test.lua"].name) + cy.contains(dir.contents["initial-file.txt"].name) + }) + }) + it("can send file names to the quickfix list", () => { startNeovimWithYa().then((dir) => { cy.typeIntoTerminal("{upArrow}")