Skip to content

Commit

Permalink
divided for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
ignapas committed Nov 27, 2023
1 parent bad2542 commit 41e3758
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/e2e/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,10 @@ async function getDashboardCardLabel(page, selector) {
const cardLabel = await page.evaluate((selector) => {
let label = null;
const card = document.querySelector(selector);
if (card && card.children && card.children.length && card.children[0].children.length > 1) {
label = card.children[0].children[1].innerText;
if (card && card.children && card.children.length) {
if (card.children[0].children && card.children[0].children.length > 1) {
label = card.children[0].children[1].innerText;
}
}
return label;
}, selector);
Expand Down

0 comments on commit 41e3758

Please sign in to comment.