Skip to content

Commit 755cf0d

Browse files
One more E2E fix
Signed-off-by: Lukasz Gryglicki <lgryglicki@cncf.io> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
1 parent 800aa66 commit 755cf0d

File tree

1 file changed

+6
-30
lines changed

1 file changed

+6
-30
lines changed

tests/functional/cypress/e2e/v4/signatures.cy.ts

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -541,17 +541,7 @@ describe('To Validate & get list of signatures of ClaGroups via API call', funct
541541
}).then((response) => {
542542
validate_200_Status(response);
543543
let list = response.body.githubUsernameApprovalList;
544-
let found = false;
545-
for (let i = 0; i < list.length; i++) {
546-
if (list[i] === gitUsernameApprovalList) {
547-
expect(list[i]).to.eql(gitUsernameApprovalList);
548-
found = true;
549-
break;
550-
}
551-
}
552-
if (!found) {
553-
expect.fail('GitHub Username not found in approval list');
554-
}
544+
expect(list).to.include(gitUsernameApprovalList);
555545
});
556546
});
557547

@@ -571,10 +561,8 @@ describe('To Validate & get list of signatures of ClaGroups via API call', funct
571561
}).then((response) => {
572562
validate_200_Status(response);
573563
let list = response.body.githubUsernameApprovalList;
574-
if (list != null) {
575-
for (let i = 0; i < list.length; i++) {
576-
expect(list[i]).to.not.equal(gitUsernameApprovalList);
577-
}
564+
if (list != null && list.length > 0) {
565+
expect(list).to.not.include(gitUsernameApprovalList);
578566
}
579567
});
580568
});
@@ -595,17 +583,7 @@ describe('To Validate & get list of signatures of ClaGroups via API call', funct
595583
}).then((response) => {
596584
validate_200_Status(response);
597585
let list = response.body.gitlabUsernameApprovalList;
598-
let found = false;
599-
for (let i = 0; i < list.length; i++) {
600-
if (list[i] === gitUsernameApprovalList) {
601-
expect(list[i]).to.eql(gitUsernameApprovalList);
602-
found = true;
603-
break;
604-
}
605-
}
606-
if (!found) {
607-
expect.fail('GitLab Username not found in approval list');
608-
}
586+
expect(list).to.include(gitUsernameApprovalList);
609587
});
610588
});
611589

@@ -625,10 +603,8 @@ describe('To Validate & get list of signatures of ClaGroups via API call', funct
625603
}).then((response) => {
626604
validate_200_Status(response);
627605
let list = response.body.gitlabUsernameApprovalList;
628-
if (list != null) {
629-
for (let i = 0; i < list.length; i++) {
630-
expect(list[i]).to.not.equal(gitUsernameApprovalList);
631-
}
606+
if (list != null && list.length > 0) {
607+
expect(list).to.not.include(gitUsernameApprovalList);
632608
}
633609
});
634610
});

0 commit comments

Comments
 (0)