Skip to content

Commit

Permalink
correct issue with getActionButton not finding the correct item
Browse files Browse the repository at this point in the history
  • Loading branch information
tylor-metrics committed Jun 12, 2024
1 parent f918d9b commit bbd1448
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pageobjects/sidebar/ViewItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ export abstract class TreeItem extends ViewItem {
async getActionButton (label: string): Promise<ViewItemAction | undefined> {
const actions = await this.getActionButtons()
if (actions.length > 0) {
return actions.find((item) => item.getLabel().indexOf(label) > -1)
for (let item of actions) {

Check failure on line 164 in src/pageobjects/sidebar/ViewItem.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 1.86.0)

'item' is never reassigned. Use 'const' instead
let itemLabel = item.getLabel() ?? await item.elem.getAttribute('aria-label');

Check failure on line 165 in src/pageobjects/sidebar/ViewItem.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 1.86.0)

'itemLabel' is never reassigned. Use 'const' instead

Check failure on line 165 in src/pageobjects/sidebar/ViewItem.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 1.86.0)

Extra semicolon
if (itemLabel.indexOf(label) > -1) {
return item;

Check failure on line 167 in src/pageobjects/sidebar/ViewItem.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 1.86.0)

Extra semicolon
}
}
}
return undefined
}
Expand Down

0 comments on commit bbd1448

Please sign in to comment.