Skip to content

Commit

Permalink
test: add integration test for opening in a new tab (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas authored Jul 22, 2024
1 parent d451ccf commit c3974f7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit c3974f7

Please sign in to comment.