coronasafe/care_fe

View on GitHub
cypress/pageObject/Users/UserCreation.ts

Summary

Maintainability
C
1 day
Test Coverage

Showing 5 of 5 total issues

UserCreation has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

export class UserCreation {
clickAddUserButton() {
cy.verifyAndClickElement('[data-cy="add-user-button"]', "Add User");
return this;
}
Severity: Minor
Found in cypress/pageObject/Users/UserCreation.ts - About 2 hrs to fix

Function fillUserDetails has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

fillUserDetails(userData: UserData & { confirmPassword?: string }) {
if (userData.userType) this.selectUserType(userData.userType);
if (userData.firstName) this.fillFirstName(userData.firstName);
if (userData.lastName) this.fillLastName(userData.lastName);
if (userData.username) this.fillUsername(userData.username);
Severity: Minor
Found in cypress/pageObject/Users/UserCreation.ts - About 1 hr to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

cy.verifyErrorMessages([
{ label: "First Name", message: "This field is required" },
{ label: "Last Name", message: "This field is required" },
{ label: "Username", message: "This field is required" },
{ label: "Password", message: "This field is required" },
Severity: Major
Found in cypress/pageObject/Users/UserCreation.ts and 1 other location - About 1 hr to fix
src/components/Files/FilesTab.tsx on lines 107..114

Similar blocks of code found in 8 locations. Consider refactoring.
Open

verifyUserCreationApiCall() {
cy.wait("@createUser").then((interception) => {
expect(interception.response?.statusCode).to.equal(200);
});
return this;
Severity: Major
Found in cypress/pageObject/Users/UserCreation.ts and 7 other locations - About 1 hr to fix
cypress/pageObject/Patients/PatientFiles.ts on lines 91..96
cypress/pageObject/Patients/PatientFiles.ts on lines 98..103
cypress/pageObject/Patients/PatientFiles.ts on lines 105..110
cypress/pageObject/Patients/PatientLocation.ts on lines 54..59
cypress/pageObject/Users/UserCreation.ts on lines 168..173
cypress/pageObject/resources/ResourcesCreation.ts on lines 89..94
cypress/pageObject/resources/ResourcesCreation.ts on lines 96..101

Similar blocks of code found in 8 locations. Consider refactoring.
Open

verifyOrganizationUserLinkingApiCall() {
cy.wait("@linkUserToOrg").then((interception) => {
expect(interception.response?.statusCode).to.equal(200);
});
return this;
Severity: Major
Found in cypress/pageObject/Users/UserCreation.ts and 7 other locations - About 1 hr to fix
cypress/pageObject/Patients/PatientFiles.ts on lines 91..96
cypress/pageObject/Patients/PatientFiles.ts on lines 98..103
cypress/pageObject/Patients/PatientFiles.ts on lines 105..110
cypress/pageObject/Patients/PatientLocation.ts on lines 54..59
cypress/pageObject/Users/UserCreation.ts on lines 156..161
cypress/pageObject/resources/ResourcesCreation.ts on lines 89..94
cypress/pageObject/resources/ResourcesCreation.ts on lines 96..101

There are no issues that match your filters.

Category
Status