Skip to content
Snippets Groups Projects
Commit 354e8cb8 authored by l26yan's avatar l26yan Committed by Liam Morland
Browse files

ISTWCMS-4630 Make "Who's online" block available for all roles

parent d3c7d60d
No related branches found
No related tags found
2 merge requests!433ISTWCMS-6296 Create test for all event dates test cases,!152ISTWCMS-4630 Make "Who's online" block available for all roles
...@@ -1415,11 +1415,32 @@ class UwWcmsBasicTest extends BrowserTestBase { ...@@ -1415,11 +1415,32 @@ class UwWcmsBasicTest extends BrowserTestBase {
* Test default dashboard. * Test default dashboard.
*/ */
private function dashboardTest() { private function dashboardTest() {
// Administrator login.
$this->drupalLogin($this->drupalUsers['administrator']); // Anonymous user cannot view 'whos-online' block in dashboard.
// Go to My Dashboard.
$this->drupalGet('dashboard/my_dashboard'); $this->drupalGet('dashboard/my_dashboard');
$this->assertSession()->statusCodeEquals(200); $this->assertSession()->statusCodeEquals(403);
// 'whos-online' block can be viewed by all roles.
$roles = [
'authenticated user',
'uw_role_site_owner',
'uw_role_site_manager',
'uw_role_content_editor',
'uw_role_content_author',
'uw_role_form_editor',
'uw_role_form_results_access',
'administrator',
];
foreach ($roles as $role) {
$this->drupalLogin($this->drupalUsers[$role]);
$this->drupalGet('dashboard/my_dashboard');
if ($role != 'authenticated user') {
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains("Who's online");
}
else {
$this->assertSession()->statusCodeEquals(403);
}
}
// Site footer button label is 'Add/edit'. // Site footer button label is 'Add/edit'.
$this->assertSession()->linkExists('Add/edit'); $this->assertSession()->linkExists('Add/edit');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment