diff --git a/tests/signal.js b/tests/signal.js index 77c8c63..ce9a6b2 100644 --- a/tests/signal.js +++ b/tests/signal.js @@ -8,6 +8,7 @@ const Gtk = gi.require('Gtk', '3.0') const Gdk = gi.require('Gdk', '3.0') const GObject = gi.require('GObject') const { describe, it, mustThrow, assert, expect } = require('./__common__.js') +const common = require("./__common__"); gi.startLoop() Gtk.init() @@ -86,6 +87,20 @@ window.on('show', () => { ) }) + describe('Trigger "on-focus-out-event" should work', async () => new Promise((resolve) => { + const entry = new Gtk.SearchEntry(); + const event = new Gdk.EventFocus() + event.type = Gdk.EventType.FOCUS_CHANGE + event.window = entry.getWindow() + event.sendEvent = 1 + + entry.on('focus-out-event', (event) => { + resolve(); + }) + + const result = entry.emit('focus-out-event', event) + })); + describe('types are as correct as possible', () => { const event = new Gdk.EventButton() event.type = Gdk.EventType.BUTTON_PRESS