Skip to content

Commit

Permalink
test(refactor): try to select multiple action texts
Browse files Browse the repository at this point in the history
  • Loading branch information
anon-pradip committed Aug 19, 2024
1 parent 8ea256a commit a479715
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/e2e/cucumber/steps/ui/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,11 +926,12 @@ Then(
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const resourceObject = new objects.applicationFiles.Resource({ page })
for (const info of stepTable.hashes()) {
if (actionType === 'should') {
expect(await resourceObject.getAllAvailableActions({ resource })).toContain(info.action)
} else {
expect(await resourceObject.getAllAvailableActions({ resource })).not.toContain(info.action)
}
const actions = await resourceObject.getAllAvailableActions({ resource });
if (actionType === 'should') {
expect(actions.some(item => item.includes(info.action))).toBe(true);
} else {
expect(actions.some(item => item.includes(info.action))).toBe(false);
}
}
}
)
Expand Down

0 comments on commit a479715

Please sign in to comment.