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.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
87
gaia/apps/email/test/marionette/notification_click_test.js
Executable file
87
gaia/apps/email/test/marionette/notification_click_test.js
Executable file
|
|
@ -0,0 +1,87 @@
|
|||
/*jshint node: true */
|
||||
/*global marionette, setup, test */
|
||||
'use strict';
|
||||
|
||||
var Email = require('./lib/email');
|
||||
var EmailSync = require('./lib/email_sync');
|
||||
var NotificationLib = require('./lib/notification');
|
||||
var serverHelper = require('./lib/server_helper');
|
||||
|
||||
marionette('email notifications, click', function() {
|
||||
var app, sync, notification,
|
||||
client = marionette.client({
|
||||
desiredCapabilities: { raisesAccessibilityExceptions: false }
|
||||
}),
|
||||
server1 = serverHelper.use({
|
||||
credentials: {
|
||||
username: 'testy1',
|
||||
password: 'testy1'
|
||||
}
|
||||
}, this),
|
||||
server2 = serverHelper.use({
|
||||
credentials: {
|
||||
username: 'testy2',
|
||||
password: 'testy2'
|
||||
}
|
||||
}, this);
|
||||
|
||||
function sendEmail(server) {
|
||||
var email = server.imap.username + '@' + server.imap.hostname;
|
||||
app.tapCompose();
|
||||
app.typeTo(email);
|
||||
app.typeSubject('test email');
|
||||
app.typeBody('I still have a dream.');
|
||||
app.tapSend();
|
||||
}
|
||||
|
||||
function configureAndSend(messageCount) {
|
||||
|
||||
// Set up testy1, send email to testy1, since smtp fakserver
|
||||
// is paired with the imap fakserver for that account. So,
|
||||
// no cross sending of email across fakeserver instances.
|
||||
app.manualSetupImapEmail(server1);
|
||||
|
||||
for (var i = 0; i < messageCount; i++) {
|
||||
sendEmail(server1);
|
||||
}
|
||||
|
||||
// Now set up second account, to confirm system notifications
|
||||
// are only triggered in certain situations.
|
||||
app.tapFolderListButton();
|
||||
app.tapSettingsButton();
|
||||
app.tapAddAccountButton();
|
||||
app.manualSetupImapEmail(server2);
|
||||
}
|
||||
|
||||
setup(function() {
|
||||
app = new Email(client);
|
||||
notification = new NotificationLib(client);
|
||||
sync = new EmailSync(client);
|
||||
sync.setup();
|
||||
|
||||
app.launch();
|
||||
});
|
||||
|
||||
test('show message_reader for 1 message notification', function() {
|
||||
configureAndSend(1);
|
||||
|
||||
sync.triggerSync();
|
||||
|
||||
notification.triggerFirstNotification();
|
||||
|
||||
// Since a single message notification, should go to message_reader.
|
||||
app.waitForMessageReader();
|
||||
});
|
||||
|
||||
test('show message_list for multiple message notification',
|
||||
function() {
|
||||
configureAndSend(2);
|
||||
|
||||
sync.triggerSync();
|
||||
|
||||
notification.triggerFirstNotification();
|
||||
|
||||
// Since a single message notification, should go to message_reader.
|
||||
app.waitForMessageList();
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue