mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Merge branch 'MDL-80384-main' of https://github.com/junpataleta/moodle
This commit is contained in:
commit
638de6002a
@ -21,8 +21,6 @@
|
||||
|
||||
Example context (json):
|
||||
{
|
||||
"uservisible": true,
|
||||
"url": "#",
|
||||
"icon": "../../../pix/help.svg",
|
||||
"iconclass": "",
|
||||
"purpose": "content",
|
||||
@ -32,22 +30,13 @@
|
||||
"showtooltip": 1
|
||||
}
|
||||
}}
|
||||
{{#url}}
|
||||
{{#uservisible}}
|
||||
<a href="{{url}}"
|
||||
class="activity-icon activityiconcontainer smaller {{purpose}} {{#branded}}isbranded{{/branded}} btn btn-link courseicon align-self-start mr-2"
|
||||
{{#showtooltip}}data-toggle="tooltip" title="{{{pluginname}}}" data-placement="top"{{/showtooltip}}
|
||||
>
|
||||
<img src="{{{icon}}}" class="activityicon {{iconclass}}"
|
||||
alt="{{#cleanstr}} activityicon, moodle, {{{pluginname}}} {{/cleanstr}}"
|
||||
>
|
||||
</a>
|
||||
{{/uservisible}}
|
||||
{{^uservisible}}
|
||||
<div class="activity-icon activityiconcontainer smaller {{purpose}} {{#branded}}isbranded{{/branded}} courseicon align-self-start mr-2">
|
||||
<img src="{{{icon}}}" class="activityicon {{iconclass}}"
|
||||
alt="{{#cleanstr}} activityicon, moodle, {{{pluginname}}} {{/cleanstr}}"
|
||||
<img
|
||||
src="{{{icon}}}"
|
||||
class="activityicon {{iconclass}}"
|
||||
data-region="activity-icon"
|
||||
data-id="{{cmid}}"
|
||||
alt="{{#showtooltip}}{{#cleanstr}} activityicon, moodle, {{{pluginname}}} {{/cleanstr}}{{/showtooltip}}"
|
||||
{{#showtooltip}}title="{{{pluginname}}}"{{/showtooltip}}
|
||||
>
|
||||
</div>
|
||||
{{/uservisible}}
|
||||
{{/url}}
|
||||
|
@ -25,20 +25,15 @@ Feature: Activity type tooltip.
|
||||
|
||||
Scenario: Teacher can see the activity type tooltip only while editing.
|
||||
Given I am on the "C1" "Course" page logged in as "teacher1"
|
||||
And I hover over the "Assignment icon" "link" in the "Activity sample 1" "activity"
|
||||
And "body>.tooltip" "css_element" should not exist
|
||||
And I hover over the "Page icon" "link" in the "Activity sample 2" "activity"
|
||||
And "body>.tooltip" "css_element" should not exist
|
||||
And the "title" attribute of "Activity sample 1" "core_courseformat > Activity icon" should not be set
|
||||
And the "title" attribute of "Activity sample 2" "core_courseformat > Activity icon" should not be set
|
||||
And I turn editing mode on
|
||||
When I hover over the "Assignment icon" "link" in the "Activity sample 1" "activity"
|
||||
Then I should see "Assignment" in the "body>.tooltip" "css_element"
|
||||
And I hover over the "Page icon" "link" in the "Activity sample 2" "activity"
|
||||
And I should see "Page" in the "body>.tooltip" "css_element"
|
||||
Then the "title" attribute of "Activity sample 1" "core_courseformat > Activity icon" should contain "Assignment"
|
||||
And the "title" attribute of "Activity sample 2" "core_courseformat > Activity icon" should contain "Page"
|
||||
|
||||
Scenario: Student cannot see the activity type tooltip.
|
||||
Given I am on the "C1" "Course" page logged in as "student1"
|
||||
When I hover over the "Assignment icon" "link" in the "Activity sample 1" "activity"
|
||||
Then "body>.tooltip" "css_element" should not exist
|
||||
Then the "title" attribute of "Activity sample 1" "core_courseformat > Activity icon" should not be set
|
||||
|
||||
Scenario: Student cannot see the activity icon link if does not have access.
|
||||
Given I am on the "Activity sample 2" "page activity editing" page logged in as "admin"
|
||||
|
@ -44,6 +44,9 @@ class behat_courseformat extends behat_base {
|
||||
new behat_component_named_selector('Activity visibility', [
|
||||
".//*[@data-activityname=%locator%]//*[@data-region='visibility']",
|
||||
]),
|
||||
new behat_component_named_selector('Activity icon', [
|
||||
".//*[@data-activityname=%locator%]//*[@data-region='activity-icon']",
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user