mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-13 10:58:51 -05:00
server: send new version on updater:check
This commit is contained in:
@@ -79,7 +79,7 @@ class UpdateBanner extends Component {
|
||||
ipc.offUpdaterCheck()
|
||||
ipc.updaterCheck()
|
||||
.then((version) => {
|
||||
appStore.setNewVersion(version)
|
||||
if (version) appStore.setNewVersion(version)
|
||||
})
|
||||
.catch((error) => {
|
||||
console.warn('Error checking for updates:', error) // eslint-disable-line no-console
|
||||
|
||||
@@ -113,7 +113,7 @@ handleEvent = (options, bus, event, id, type, arg) ->
|
||||
|
||||
when "updater:check"
|
||||
Updater.check({
|
||||
onNewVersion: -> send(true)
|
||||
onNewVersion: ({ version }) -> send(version)
|
||||
onNoNewVersion: -> send(false)
|
||||
})
|
||||
|
||||
|
||||
@@ -183,10 +183,10 @@ describe "lib/gui/events", ->
|
||||
|
||||
context "updating", ->
|
||||
describe "updater:check", ->
|
||||
it "returns true when new version", ->
|
||||
@sandbox.stub(Updater, "check").yieldsTo("onNewVersion")
|
||||
it "returns version when new version", ->
|
||||
@sandbox.stub(Updater, "check").yieldsTo("onNewVersion", {version: "1.2.3"})
|
||||
@handleEvent("updater:check")
|
||||
@expectSendCalledWith(true)
|
||||
@expectSendCalledWith("1.2.3")
|
||||
|
||||
it "returns false when no new version", ->
|
||||
@sandbox.stub(Updater, "check").yieldsTo("onNoNewVersion")
|
||||
|
||||
Reference in New Issue
Block a user