Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Manvel committed Mar 28, 2024
1 parent f22216c commit c830ea5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cba-list/cba-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ export class List extends HTMLElement
_renderTooltip(infoElem, item)
{
const infoText = item.description || "";
const subitems = item.link ? html`<a href="${item.link}">${item.linkText}</a>` : "";
const subitems = item.link ? html`<a href="${item.link}">${item.linkText || "Learn more"}</a>` : "";
render(html`<p>${infoText}</p>${subitems}`, this.tooltip);
const infoRect = infoElem.getBoundingClientRect();
const offsetTop = (infoRect.top + infoRect.height / 2) - this.getBoundingClientRect().top - 2;
Expand Down
2 changes: 1 addition & 1 deletion tests/puppeteer/classes/CbaList.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CbaList extends Common
async getRowInfoHandle(id)
{
const rowHandel = await this.getRowHandle(id);
return rowHandel.$(".hasInfo");
return rowHandel.$(".info");
}
async getTooltipAttribute(attribute)
{
Expand Down
12 changes: 7 additions & 5 deletions tests/puppeteer/tests/cba-list-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ it("cba-list rows with matching data of tooltip-text and tooltip-link attribute
id: tooltipRowId,
data: "Info",
text: "List3",
tooltip: {
text: tooltipText,
info: {
description: "Tooltip text",
type: "info",
link: tooltipLink,
linkText: tooltipLinkText
}
Expand All @@ -45,9 +46,10 @@ it("cba-list rows with matching data of tooltip-text and tooltip-link attribute
id: tooltipNoLinkTextRowId,
data: "Info",
text: "List4",
tooltip: {
text: tooltipText,
link: tooltipLink
info: {
description: "Tooltip text",
type: "info",
link: tooltipLink,
}
},
];
Expand Down

0 comments on commit c830ea5

Please sign in to comment.