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 cb9e667
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ window.on('show', () => {
)
})

describe('Trigger "on-focus-out-event" should work', async () => new Promise((resolve, reject) => {
const searchEntry = new Gtk.SearchEntry();
const event = new Gdk.EventFocus()
event.type = Gdk.EventType.FOCUS_CHANGE
event.window = searchEntry.getWindow()
event.sendEvent = 1

searchEntry.on('focus-out-event', (event) => resolve())
searchEntry.emit('focus-out-event', event);
// In case resolve is never called, do not block test indefinitely
setTimeout(() => reject(), 1000);
}));

describe('types are as correct as possible', () => {
const event = new Gdk.EventButton()
event.type = Gdk.EventType.BUTTON_PRESS
Expand Down

0 comments on commit cb9e667

Please sign in to comment.