Skip to content

Commit

Permalink
Merge branch 'release-1.53.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
olga-kulish committed Mar 18, 2022
2 parents a0ee3d3 + 548e9b9 commit 6bbf0f7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oat-sa/tao-core-ui",
"version": "1.52.0",
"version": "1.53.0",
"displayName": "TAO Core UI",
"description": "UI libraries of TAO",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/itemButtonList.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const cssSelectors = {
* @property {String} scoreType - 'correct'/'incorrect'/null
* @property {String} icon - 'info'/'flagged'/null
* @property {Boolean} disabled
* @property {String} [title] - optional tooltip
*/
/**
* Item Button List
Expand Down
1 change: 1 addition & 0 deletions src/itemButtonList/tpl/itemButtonList.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<li class="buttonlist-item {{status}}{{#if scoreType}} {{scoreType}}{{/if}}{{#if disabled}} disabled{{/if}}" data-id="{{id}}">
<button class="buttonlist-btn"
role="link"
{{#if title}}title="{{title}}"{{/if}}
aria-label="{{ariaLabel}}"
{{#if disabled}}aria-disabled="true"{{/if}}
data-id="{{id}}">
Expand Down
17 changes: 13 additions & 4 deletions test/itemButtonList/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ define([
"status": "answered",
"icon": null,
"ariaLabel": "Question 1",
"scoreType": "correct"
"scoreType": "correct",
"title": "This is the first question"
},
{
"id": "item-2",
Expand Down Expand Up @@ -147,7 +148,7 @@ define([
};
let instance;

assert.expect(18);
assert.expect(19);

// Create an instance with autorendering
instance = itemButtonList(config);
Expand Down Expand Up @@ -224,6 +225,12 @@ define([
basicItems.filter(item => item.icon === 'flagged').length,
'The itemButtonList instance has rendered the correct number of flagged icon buttons'
);
//Check title tooltip
assert.equal(
instance.getElement().find('button')[0].title,
basicItems[0].title,
'The itemButtonList instance has rendered the button with the correct tooltip'
);

instance.destroy();

Expand Down Expand Up @@ -491,7 +498,8 @@ define([
"status": "answered",
"icon": null,
"ariaLabel": "Question 1",
"scoreType": "correct"
"scoreType": "correct",
"title": "This is the first question"
},
{
"id": "item-2",
Expand All @@ -500,7 +508,8 @@ define([
"status": "viewed",
"icon": null,
"ariaLabel": "Question 2",
"scoreType": null
"scoreType": null,
"title": "This is the second question"
},
{
"id": "item-3",
Expand Down

0 comments on commit 6bbf0f7

Please sign in to comment.