@cypress/core-desktop-gui
Version:
Desktop GUI for managing Cypress projects.
80 lines (60 loc) • 2.63 kB
text/coffeescript
describe "Updates", ->
beforeEach ->
cy
.viewport(300, 210)
.visit("/updates.html")
.window().then (win) ->
{, } = win
= cy.agents()
.spy(, "ipc")
= "1.78"
.handle("get:options", null, {version: })
it "has updates title", ->
cy.title().should("include", "Updates")
it "displays loading spinner before updater:run is called", ->
cy.get(".loader").should("exist")
it "triggers updater:run", ->
expect(.ipc).to.be.calledWith("updater:run")
it "links to Changelog", ->
.handle("updater:run", null, {event: "none"})
cy.contains("a", "View Changelog").click().then ->
expect(.ipc).to.be.calledWith("external:open", "https://on.cypress.io/changelog")
it "displays current version", ->
.handle("updater:run", null, {event: "none"})
cy.get(".version").contains()
describe "updater:run start", ->
it "displays check for updates msg", ->
.handle("updater:run", null, {event: "start"})
cy.contains("Checking for updates...")
describe "updater:run apply", ->
it "displays applying updates msg", ->
.handle("updater:run", null, {event: "apply"})
cy.contains("Applying updates...")
describe "updater:run error", ->
it "displays error msg", ->
.handle("updater:run", null, {event: "error"})
cy.contains("An error occurred updating")
it "triggers window:close on click of close btn", ->
.handle("updater:run", null, {event: "error"})
cy.contains(".btn", "Done").click().then ->
expect(.ipc).to.be.calledWith("window:close")
describe "updater:run none", ->
it "displays none msg", ->
.handle("updater:run", null, {event: "none"})
cy.contains("No updates available")
it "triggers window:close on click of close btn", ->
.handle("updater:run", null, {event: "none"})
cy.contains(".btn", "Done").click().then ->
expect(.ipc).to.be.calledWith("window:close")
describe "updater:run download", ->
it "displays download msg", ->
.handle("updater:run", null, {event: "download"})
cy.contains("Downloading updates...")
describe "updater:run done", ->
it "displays done msg", ->
.handle("updater:run", null, {event: "done"})
cy.contains("Updates ready")
it "triggers window:close on click of restart btn", ->
.handle("updater:run", null, {event: "done"})
cy.contains(".btn", "Restart").click().then ->
expect(.ipc).to.be.calledWith("window:close")