Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
CapitaineJSparrow committed Oct 4, 2022
1 parent 23d6474 commit e70b3d6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e70b3d6

Please sign in to comment.