@cypress/core-desktop-gui
Version:
Desktop GUI for managing Cypress projects.
44 lines (29 loc) • 853 B
text/coffeescript
describe "App Ipc", ->
beforeEach ->
cy
.visit("/")
.window().then (win) ->
{, } = win
= cy.agents()
context "#off", ->
it "removes queued messages by event name", ->
.ipc("foo:bar:baz", ->)
getEvent = =>
msgs = .ipc()
Cypress._.find msgs, (msg) ->
msg.event is "foo:bar:baz"
expect(getEvent()).to.be.ok
.ipc.off("foo:bar:baz")
expect(getEvent()).to.be.undefined
context "#offById", ->
it "can remove queued messages by its id", ->
.ipc("foo:bar:baz", ->)
getId = =>
msgs = .ipc()
for id, msg of msgs
if msg.event is "foo:bar:baz"
return id
id = getId()
expect(id).to.be.ok
.ipc.offById(id)
expect(getId()).to.be.undefined