From 4cd087ea2eb8d1dbc8a063b41cffcd5df35d7df6 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 13 Sep 2015 08:50:16 -0400
Subject: [PATCH] Fixed mailvelope-generated messages structure (required Mail_Mime-1.10.0)
---
tests/Selenium/Mail/Getunread.php | 26 +++++++++++++++++++++++++-
1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/tests/Selenium/Mail/Getunread.php b/tests/Selenium/Mail/Getunread.php
index d6362f2..c18ddc0 100644
--- a/tests/Selenium/Mail/Getunread.php
+++ b/tests/Selenium/Mail/Getunread.php
@@ -2,12 +2,36 @@
class Selenium_Mail_Getunread extends Selenium_Test
{
+ protected $msgcount = 0;
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ bootstrap::init_imap();
+ bootstrap::purge_mailbox('INBOX');
+
+ // import email messages
+ foreach (glob(TESTS_DIR . 'Selenium/data/mail/list_*.eml') as $f) {
+ bootstrap::import_message($f, 'INBOX');
+ $this->msgcount++;
+ }
+ }
+
public function testGetunread()
{
$this->go('mail');
$res = $this->ajaxResponse('getunread', "rcmail.http_request('getunread')");
-
$this->assertEquals('getunread', $res['action']);
+
+ $env = $this->get_env();
+ $this->assertEquals($env['unread_counts']['INBOX'], $this->msgcount);
+
+ $li = $this->byCssSelector('.folderlist li.inbox');
+ $this->assertHasClass('unread', $li);
+
+ $badge = $this->byCssSelector('.folderlist li.inbox span.unreadcount');
+ $this->assertEquals(strval($this->msgcount), $this->getText($badge));
}
}
--
Gitblit v1.9.1