Files
roundcubemail/tests/Browser/Mail/MailTest.php
Michael Voříšek 6a53a1d853 Fix CS (whitespace, visibility) (#9297)
* Fix "method_argument_space"

* Fix "control_structure_continuation_position"

* Fix "new_with_parentheses"

* Fix "blank_line_before_statement"

* Fix "visibility_required"

* Fix some "array_indentation"

* Fix some "array_indentation" - unify all "rcube::raise_error" calls

* rm useless eslint ignores and add rules counts

* sort eslint ignores

* fix eslint ignores grammar

* Revert "Fix "blank_line_before_statement""

* fix CS 3.46.0
2024-01-04 14:26:35 +01:00

85 lines
2.5 KiB
PHP

<?php
namespace Tests\Browser\Mail;
use Tests\Browser\Components\App;
use Tests\Browser\Components\Popupmenu;
class MailTest extends \Tests\Browser\TestCase
{
public function testMailUI()
{
$this->browse(static function ($browser) {
$browser->go('mail');
// check task
$browser->with(new App(), static function ($browser) {
$browser->assertEnv('task', 'mail');
// these objects should be there always
$browser->assertObjects([
'qsearchbox',
'mailboxlist',
'messagelist',
'quotadisplay',
'search_filter',
'countdisplay',
]);
});
if (!$browser->isDesktop()) {
$browser->click('.back-sidebar-button');
}
$browser->assertSeeIn('#layout-sidebar .header', TESTS_USER);
// Folders list
$browser->assertVisible('#mailboxlist li.mailbox.inbox.selected');
if (!$browser->isDesktop()) {
$browser->click('.back-list-button');
}
// Mail preview frame
if (!$browser->isPhone()) {
$browser->assertVisible('#messagecontframe');
}
// Toolbar menu
$browser->assertToolbarMenu(
['more'], // active items
['reply', 'reply-all', 'forward', 'delete', 'markmessage'], // inactive items
);
// Task menu
$browser->assertTaskMenu('mail');
});
}
/**
* Test message menu
*/
public function testMessageMenu()
{
$this->browse(static function ($browser) {
$browser->go('mail');
$browser->clickToolbarMenuItem('more', null, false);
$browser->with(new Popupmenu('message-menu'), static function ($browser) {
// Note: These are button class names, not action names
$active = ['import'];
$disabled = ['print', 'download', 'edit.asnew', 'source', 'move', 'copy', 'extwin'];
$hidden = [];
if ($browser->isPhone()) {
$hidden = ['print', 'extwin'];
$disabled = array_diff($disabled, $hidden);
}
$browser->assertMenuState($active, $disabled, $hidden)
->closeMenu();
});
});
}
}