@cypress/core-desktop-gui
Version:
Desktop GUI for managing Cypress projects.
50 lines (41 loc) • 1.58 kB
text/coffeescript
describe "Update Banner", ->
beforeEach ->
cy
.visit("/#/projects")
.window().then (win) ->
{, } = win
= cy.agents()
.spy(, "ipc")
.handle("get:options", null, {})
.fixture("user").then () ->
.handle("get:current:user", null, )
.fixture("projects").then () ->
.handle("get:project:paths", null, )
it "does not display update banner when no update available", ->
.handle("updater:check", null, false)
cy
.get("#updates-available").should("not.exist")
.get("html").should("not.have.class", "has-updates")
it "checks for update on show", ->
cy.then ->
expect(.ipc).to.be.calledWith("updater:check")
it "displays banner if updater:check is new version", ->
.handle("updater:check", null, "1.3.4")
cy.get("#updates-available").should("be.visible")
cy.contains("New updates are available")
cy
.get("html").should("have.class", "has-updates")
it "triggers open:window on click of Update link", ->
.handle("updater:check", null, "1.3.4")
cy.contains("Update").click().then ->
expect(.ipc).to.be.calledWith("window:open", {
position: "center"
width: 300
height: 210
toolbar: false
title: "Updates"
type: "UPDATES"
})
it "gracefully handles error", ->
.handle("updater:check", {name: "foo", message: "Something bad happened"}, null)
cy.get(".footer").should("be.visible")