test: ensure sender-pid hint is set in Linux notifications (#43928)

test: expect a `sender-pid` hint in Linux notifications.

This PR ensures that the `sender-pid` hint is set for new notifications.
It also updates the spec to confirm that DBus receives the hint and that
it has the correct value.

This fixes a spec failure when running libnotify >= 0.7.12 (2022-05-05).
Starting with that version, libnotify started injecting `sender-pid` if
not provided by the client. So our tests received a slightly different
DBus payload depending on what version of libnotify was installed,
causing our deep-equals tests to fail.

By always providing and testing the `sender-pid` hint, our behavior and
tests should be consistent across distros.
This commit is contained in:
Charles Kerr 2024-09-25 06:20:36 -05:00 committed by GitHub
parent 30fbeec036
commit 1d3b1284c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View file

@ -124,6 +124,7 @@ ifdescribe(!skip)('Notification module (dbus)', () => {
append: 'true',
image_data: [3, 3, 12, true, 8, 4, Buffer.from([255, 0, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 76, 255, 0, 255, 0, 0, 0, 255, 0, 0, 0, 0, 0, 38, 255, 255, 0, 0, 0, 255, 0, 0, 0, 0])],
'desktop-entry': appName,
'sender-pid': process.pid,
urgency: 1
}
});