Add failing test for #1511 (focus when composing)

Next step is to make the test pass.

(imported from commit a9401366c63166f39b8b73d6228c845af10c931a)
This commit is contained in:
Scott Feeney 2013-07-15 17:44:59 -04:00
parent bd63fdf81c
commit 82e33881b5
1 changed files with 16 additions and 0 deletions

View File

@ -37,6 +37,9 @@ casper.waitUntilVisible('#stream', function () {
// Check that when you reply to a message it pre-populates the stream and subject fields // Check that when you reply to a message it pre-populates the stream and subject fields
casper.click('body'); casper.click('body');
});
casper.waitWhileVisible('#stream', function () {
casper.clickLabel("We reply to this message"); casper.clickLabel("We reply to this message");
}); });
@ -72,6 +75,19 @@ casper.waitWhileVisible('#private-message', function () {
casper.test.assertNotVisible('#private-message', 'Close PM compose box'); casper.test.assertNotVisible('#private-message', 'Close PM compose box');
}); });
// Test focus after narrowing to PMs with a user and typing 'c'
casper.then(function () {
casper.click('*[title="Narrow to your private messages with Cordelia Lear"]');
});
casper.waitUntilVisible('#tab_list li.private_message', function () {
casper.page.sendEvent('keypress', 'c');
});
casper.waitUntilVisible('#compose', function () {
casper.test.assertEval(function () {
return document.activeElement === $('#stream')[0];
}, 'Stream box focused after narrowing to PMs with a user and pressing `c`');
});
common.then_log_out(); common.then_log_out();
casper.run(function () { casper.run(function () {