Skip to content

Commit

Permalink
MDL-74199 core_user: Remove breadcrumbs on private files
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaia Anabitarte committed Mar 15, 2022
1 parent 9344149 commit c28b5ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/navigationlib.php
Expand Up @@ -3042,6 +3042,7 @@ public function add_front_page_course_essentials(navigation_node $coursenode, st
self::TYPE_SETTING, null, 'privatefiles', new pix_icon('i/privatefiles', ''));
$node->display = false;
$node->showinflatnavigation = true;
$node->mainnavonly = true;
}
}

Expand Down
17 changes: 13 additions & 4 deletions theme/boost/tests/behat/breadcrumb.feature
Expand Up @@ -45,34 +45,43 @@ Feature: Breadcrumbs navigation
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Manage courses and categories" in the ".breadcrumb" "css_element"

Scenario: Admin user sets the default home page to 'Site' and navigates to its 'Preferences' page
Scenario: Admin user sets the default home page to 'Site' and navigates to its 'Preferences' and 'Private files' page
Given the following config values are set as admin:
| defaulthomepage | 0 |
And I log in as "admin"
When I follow "Preferences" in the user menu
# There should be no breadcrumbs on this page.
Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"

Scenario: Admin user sets the default home page to 'Dashboard' and navigates to its 'Preferences' page
Scenario: Admin user sets the default home page to 'Dashboard' and navigates to its 'Preferences' and 'Private files' page
Given the following config values are set as admin:
| defaulthomepage | 1 |
And I log in as "admin"
When I follow "Preferences" in the user menu
# There should be no breadcrumbs on this page.
Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"
And I follow "Private files" in the user menu
# There should be no breadcrumbs on this page.
And ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"

Scenario: Admin user sets the default home page to 'User preference' and navigates to its 'Preferences' page
Scenario: Admin user sets the default home page to 'User preference' and navigates to its 'Preferences' and 'Private files' page
Given the following config values are set as admin:
| defaulthomepage | 2 |
And I log in as "admin"
When I follow "Preferences" in the user menu
# There should be no breadcrumbs on this page.
Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"
And I follow "Private files" in the user menu
# There should be no breadcrumbs on this page.
And ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"

Scenario: Admin user sets the default home page to 'My courses' and navigates to its 'Preferences' page
Scenario: Admin user sets the default home page to 'My courses' and navigates to its 'Preferences' and 'Private files' page
Given the following config values are set as admin:
| defaulthomepage | 3 |
And I log in as "admin"
When I follow "Preferences" in the user menu
# There should be no breadcrumbs on this page.
Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"
And I follow "Private files" in the user menu
# There should be no breadcrumbs on this page.
And ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"

0 comments on commit c28b5ad

Please sign in to comment.