VulpesOS/gaia/apps/system/test/marionette/lockscreen_notification_test.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

81 lines
1.9 KiB
JavaScript
Executable file

'use strict';
marionette('LockScreen notification tests', function() {
var LockScreenNotificationActions, actions, system;
var LockScreenNotificationChecks, checks;
var client = marionette.client({
profile: {
settings: {
'lockscreen.enabled': true
}
}
});
setup(function() {
system = client.loader.getAppClass('system');
system.waitForFullyLoaded();
LockScreenNotificationActions =
require('./lib/lockscreen_notification_actions');
LockScreenNotificationChecks =
require('./lib/lockscreen_notification_checks');
actions = (new LockScreenNotificationActions()).start(client);
checks = (new LockScreenNotificationChecks()).start(client);
});
test('fire notification', function() {
var details = {
tag: 'test tag',
title: 'test title',
body: 'test body',
dir: 'rtl',
lang: 'en'
};
actions
.fireNotification(details);
checks
.contains(details);
});
test('system replace notification', function() {
var oldDetails = {
tag: 'test tag, replace',
title: 'test title, replace',
body: 'test body, replace',
dir: 'rtl',
lang: 'en'
};
var newDetails = {
tag: 'test tag, replace',
title: 'new test title, replace',
body: 'new test body, replace',
dir: 'ltr',
lang: 'sr-Cyrl'
};
actions
.fireNotification(oldDetails);
checks
.contains(oldDetails);
actions
.fireNotification(newDetails);
checks
.contains(newDetails)
.not().contains(oldDetails);
});
test('close notification', function() {
var details = {
tag: 'test tag, close',
title: 'test title, close',
body: 'test body, close'
};
actions
.fireNotification(details);
checks
.contains(details);
actions
.closeNotification(details);
checks
.not().contains(details);
});
});