add mozmill test for selecting the right message after archiving, r=standard8, bug 608789
authorDavid Bienvenu <bienvenu@nventure.com>
Tue, 02 Nov 2010 16:21:00 -0700
changeset 6634 fcf9a22d240fe4de6fa010ad79740ab06d46925a
parent 6633 425b0d7f9506cf10dea04113e94b291672df631c
child 6635 e9aa02dcfc2dba20de52e29edfd87c7506f4fa8e
push idunknown
push userunknown
push dateunknown
reviewersstandard8, bug
bugs608789
add mozmill test for selecting the right message after archiving, r=standard8, bug 608789
mail/test/mozmill/folder-display/test-message-commands.js
--- a/mail/test/mozmill/folder-display/test-message-commands.js
+++ b/mail/test/mozmill/folder-display/test-message-commands.js
@@ -164,8 +164,23 @@ function monthly_archive(keep_structure)
 
 function test_folder_structure_archiving() {
   Cc["@mozilla.org/preferences-service;1"]
    .getService(Ci.nsIPrefService).getBranch(null)
    .setBoolPref("mail.identity.default.archive_keep_folder_structure", true);
   monthly_archive(true);
   yearly_archive(true);
 }
+
+function test_selection_after_archive() {
+  be_in_folder(archiveSrcFolder);
+  let identity = acctMgr.getFirstIdentityForServer(mc.folderDisplay.view.dbView
+                                                   .getMsgHdrAt(0).folder.server);
+  identity.archiveGranularity = Ci.nsIMsgIdentity.perMonthArchiveFolders;
+  // We had a bug where we would always select the 0th message after an
+  // archive, so test that we'll actually select the next remaining message
+  // by archiving rows 1 & 2 and verifying that the 3rd message gets selected.
+  let hdrToSelect = select_click_row(3);
+  select_click_row(1);
+  select_control_click_row(2);
+  archive_selected_messages();
+  assert_selected_and_displayed(hdrToSelect);
+}