Skip to content

Commit a90f335

Browse files
authored
fix(cypress): moved specific if condition upper. (#2764)
* Fix(cypress): moved specific if condition upper. * chore
1 parent 82bc4d4 commit a90f335

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

cypress/common/base.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -391,21 +391,21 @@ export class BaseMethods {
391391
return;
392392
}
393393

394-
if (parentSelector) {
395-
cy.get(parentSelector)
396-
.find(selector)
397-
.contains(text)
398-
.invoke(attr, prop)
399-
.should(isInclude? 'include' : 'not.include', value)
394+
if (parentSelector && index) {
395+
cy.get(parentSelector)
396+
.find(selector)
397+
.eq(index)
398+
.contains(text)
399+
.invoke(attr, prop)
400+
.should(isInclude? 'include' : 'not.include', value)
400401

401-
// @ts-ignore
402-
return;
402+
// @ts-ignore
403+
return;
403404
}
404405

405-
if (parentSelector && index) {
406+
if (parentSelector) {
406407
cy.get(parentSelector)
407408
.find(selector)
408-
.eq(index)
409409
.contains(text)
410410
.invoke(attr, prop)
411411
.should(isInclude? 'include' : 'not.include', value)

0 commit comments

Comments
 (0)