Skip to content

Commit

Permalink
Merge branch 'MDL-74087-master-1' of git://github.com/mihailges/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Mar 11, 2022
2 parents f4d27bd + 748ce93 commit b364b84
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 18 deletions.
15 changes: 0 additions & 15 deletions course/tests/behat/course_category_breadcrumbs.feature
Expand Up @@ -244,18 +244,3 @@ Feature: Course category breadcrumbs navigation
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Content bank" in the "region-main" "region"
And I should see "Cat 1" in the ".block_navigation .active_tree_node" "css_element"

Scenario: Admin user changes the default home page and navigates to 'course category management' page
Given I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
And I follow "Cat 1"
And I should not see "My courses" in the ".breadcrumb" "css_element"
And the following config values are set as admin:
| defaulthomepage | 3 |
And I navigate to "Courses > Manage courses and categories" in site administration
When I follow "Cat 1"
Then I should see "My courses" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".breadcrumb" "css_element"
And I should see "Manage courses and categories" in the ".breadcrumb" "css_element"
And I should see "Cat 1" in the ".page-context-header" "css_element"
And I should see "Manage course categories and courses" in the "region-main" "region"
6 changes: 3 additions & 3 deletions theme/boost/classes/boostnavbar.php
Expand Up @@ -55,6 +55,9 @@ public function __construct(\moodle_page $page) {
protected function prepare_nodes_for_boost(): void {
global $PAGE;

// Remove the navbar nodes that already exist in the primary navigation menu.
$this->remove_items_that_exist_in_navigation($PAGE->primarynav);

// Defines whether section items with an action should be removed by default.
$removesections = true;

Expand Down Expand Up @@ -94,9 +97,6 @@ protected function prepare_nodes_for_boost(): void {
}
}

$this->remove('myhome'); // Dashboard.
$this->remove('home');

// Remove 'My courses' if we are in the module context.
if ($this->page->context->contextlevel == CONTEXT_MODULE) {
$this->remove('mycourses');
Expand Down
45 changes: 45 additions & 0 deletions theme/boost/tests/behat/breadcrumb.feature
Expand Up @@ -31,3 +31,48 @@ Feature: Breadcrumbs navigation
Then I should see "Caching" in the ".breadcrumb" "css_element"
Then I should see "Cache stores" in the ".breadcrumb" "css_element"
And I should see "Memcached" in the ".breadcrumb" "css_element"

Scenario: Admin user changes the default home page and navigates to 'course category management' page
Given the following config values are set as admin:
| defaulthomepage | 3 |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And I log in as "admin"
And I navigate to "Courses > Manage courses and categories" in site administration
When I follow "Cat 1"
Then I should not see "My courses" in the ".breadcrumb" "css_element"
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
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
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"

Scenario: Admin user sets the default home page to 'User preference' and navigates to its 'Preferences' 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"

Scenario: Admin user sets the default home page to 'My courses' and navigates to its 'Preferences' 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"

0 comments on commit b364b84

Please sign in to comment.