Skip to content

Commit

Permalink
Merge branch 'develop' into fix-redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
nihal467 authored Feb 27, 2024
2 parents e207d18 + 59cb31f commit 58b0991
Show file tree
Hide file tree
Showing 106 changed files with 16,285 additions and 17,712 deletions.
30 changes: 21 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:i18next/recommended",
"plugin:tailwindcss/recommended"
"plugin:tailwindcss/recommended",
"plugin:storybook/recommended"
],
"overrides": [
{
Expand All @@ -31,7 +32,7 @@
"react/jsx-no-target-blank": "off",
"i18next/no-literal-string": "off"
}
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand All @@ -42,11 +43,14 @@
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"@typescript-eslint",
"i18next"
],
"rules": {
"quotes": ["error", "double"],
"quotes": [
"error",
"double"
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
Expand All @@ -62,21 +66,29 @@
{
"mode": "jsx-only",
"jsx-attributes": {
"include": ["label", "placeholder", "error", "title"],
"exclude": [".*"]
"include": [
"label",
"placeholder",
"error",
"title"
],
"exclude": [
".*"
]
},
"callees": {
"exclude": [".*"]
"exclude": [
".*"
]
}
}
],
"tailwindcss/no-custom-classname": "off",
"tailwindcss/migration-from-tailwind-2": "error",
"tailwindcss/classnames-order": "error",
"tailwindcss/enforces-shorthand": "error",
"tailwindcss/enforces-shorthand": "off",
"tailwindcss/no-contradicting-classname": "error"
},

"ignorePatterns": [
"dist",
"public",
Expand Down
14 changes: 5 additions & 9 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ const config: StorybookConfig = {
],
framework: {
name: "@storybook/react-vite",
options: {},
options: {
builder: {
viteConfigPath: "./.storybook/vite.config.mts",
},
},
},
docs: {
autodocs: "tag",
},
staticDirs: ["../public"],
core: {
builder: {
name: "@storybook/builder-vite",
options: {
viteConfigPath: "./.storybook/vite.config.ts",
},
},
},
};
export default config;
File renamed without changes.
80 changes: 0 additions & 80 deletions cypress/e2e/death_report_spec/death_report.cy.ts

This file was deleted.

11 changes: 11 additions & 0 deletions cypress/e2e/facility_spec/facility_creation.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,30 @@ describe("Facility Creation", () => {
facilityPage.fillExpectedDTypeCylinderRequirement(oxygenExpected);
facilityPage.selectLocation("Kochi, Kerala");
facilityPage.submitForm();
cy.closeNotification();
// create multiple bed capacity and verify card reflection
facilityPage.selectBedType("Oxygen beds");
facilityPage.fillTotalCapacity(bedCapacity);
facilityPage.fillCurrentlyOccupied(bedOccupancy);
facilityPage.clickbedcapcityaddmore();
cy.closeNotification();
facilityPage.selectBedType("Ordinary Bed");
facilityPage.fillTotalCapacity(bedCapacity);
facilityPage.fillCurrentlyOccupied(bedOccupancy);
facilityPage.clickbedcapcityaddmore();
cy.closeNotification();
facilityPage.getTotalBedCapacity().contains(totalCapacity);
facilityPage.getTotalBedCapacity().contains(totalOccupancy);
facilityPage.clickcancelbutton();
// create multiple bed capacity and verify card reflection
facilityPage.selectAreaOfSpecialization("General Medicine");
facilityPage.fillDoctorCount(doctorCapacity);
facilityPage.clickdoctorcapacityaddmore();
cy.closeNotification();
facilityPage.selectAreaOfSpecialization("Pulmonology");
facilityPage.fillDoctorCount(doctorCapacity);
facilityPage.clickdoctorcapacityaddmore();
cy.closeNotification();
facilityPage.getTotalDoctorCapacity().contains(doctorCapacity);
facilityPage.clickcancelbutton();
facilityPage.verifyfacilitynewurl();
Expand Down Expand Up @@ -186,6 +191,12 @@ describe("Facility Creation", () => {
facilityPage.getFacilityTotalBedCapacity().contains(totalOccupancy);
facilityPage.getFacilityTotalDoctorCapacity().scrollIntoView();
facilityPage.getFacilityTotalDoctorCapacity().contains(totalDoctor);
// verify the delete functionality
cy.get("#manage-facility-dropdown button").scrollIntoView();
facilityPage.clickManageFacilityDropdown();
facilityPage.clickDeleteFacilityOption();
facilityPage.confirmDeleteFacility();
cy.verifyNotification("Facility deleted successfully");
});

it("Create a new facility with single bed and doctor capacity", () => {
Expand Down
9 changes: 0 additions & 9 deletions cypress/e2e/facility_spec/facility_manage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,6 @@ describe("Facility Manage Functions", () => {
);
});

it("Delete a existing facility and verify the error message", () => {
facilityPage.clickManageFacilityDropdown();
facilityPage.clickDeleteFacilityOption();
facilityPage.confirmDeleteFacility();
facilityManage.verifySuccessMessageVisibilityAndContent(
"You do not have permission to perform this action."
);
});

afterEach(() => {
cy.saveLocalStorage();
});
Expand Down
111 changes: 108 additions & 3 deletions cypress/e2e/facility_spec/locations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import FacilityPage from "../../pageobject/Facility/FacilityCreation";
import FacilityLocation from "../../pageobject/Facility/FacilityLocation";
import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
import FacilityHome from "../../pageobject/Facility/FacilityHome";
import { v4 as uuidv4 } from "uuid";

describe("Location Management Section", () => {
const assetPage = new AssetPage();
Expand Down Expand Up @@ -40,6 +41,9 @@ describe("Location Management Section", () => {
const bedModifiedType = "Isolation";
const numberOfBeds = 10;
const numberOfModifiedBeds = 25;
const qr_id_1 = uuidv4();
const phone_number = "9999999999";
const serialNumber = Math.floor(Math.random() * 10 ** 10).toString();

before(() => {
cy.loginByApi("devdistrictadmin", "Coronasafe@123");
Expand All @@ -51,9 +55,7 @@ describe("Location Management Section", () => {
cy.restoreLocalStorage();
cy.clearLocalStorage(/filters--.+/);
cy.awaitUrl("/");
facilityPage.visitAlreadyCreatedFacility();
facilityPage.clickManageFacilityDropdown();
facilityLocation.clickFacilityLocationManagement();
facilityLocation.loadLocationManagementPage("Dummy Shifting Center");
});

it("Add a Bed to facility location along with duplication and deleting a bed", () => {
Expand Down Expand Up @@ -103,6 +105,7 @@ describe("Location Management Section", () => {
facilityLocation.verifyBedNameBadge(bedModifiedName);
facilityLocation.verifyBedBadge(bedModifiedType);
facilityLocation.verifyBedBadge(bedStatus);
facilityLocation.closeNotification();
});

it("Adds Location to a facility and modify it", () => {
Expand Down Expand Up @@ -134,6 +137,7 @@ describe("Location Management Section", () => {
facilityLocation.verifyLocationType(locationModifiedType);
facilityLocation.verifyLocationDescription(locationModifiedDescription);
facilityLocation.verifyLocationMiddleware(locationModifiedMiddleware);
facilityLocation.closeNotification();
});

it("Multiple Bed to a facility location and delete a bed", () => {
Expand All @@ -155,6 +159,7 @@ describe("Location Management Section", () => {
facilityLocation.deleteBedRequest();
assetPage.clickassetupdatebutton();
facilityLocation.deleteBedRequest();
facilityLocation.closeNotification();
});

it("Add Multiple Bed to a facility location and verify pagination", () => {
Expand All @@ -169,6 +174,106 @@ describe("Location Management Section", () => {
// pagination
assetPagination.navigateToNextPage();
assetPagination.navigateToPreviousPage();
facilityLocation.closeNotification();
});

it("Delete location", () => {
facilityLocation.clickAddNewLocationButton();
facilityLocation.enterLocationName("Test Location");
facilityLocation.selectLocationType("OTHER");
assetPage.clickassetupdatebutton();
facilityLocation.deleteLocation("Test Location");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Location Test Location deleted successfully"
);
facilityLocation.closeNotification();
});

it("Delete location with linked beds", () => {
facilityLocation.clickAddNewLocationButton();
facilityLocation.enterLocationName("Test Location with Beds");
facilityLocation.selectLocationType("OTHER");
assetPage.clickassetupdatebutton();
facilityLocation.clickManageBedButton();
facilityLocation.clickAddBedButton();
facilityLocation.enterBedName("Bed 1");
facilityLocation.selectBedType("Regular");
assetPage.clickassetupdatebutton();
facilityLocation.loadLocationManagementPage("Dummy Shifting Center");
facilityLocation.deleteLocation("Test Location with Beds");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Cannot delete a Location with associated Beds"
);
facilityLocation.closeNotification();

// delete bed
facilityLocation.clickManageBeds();
facilityLocation.deleteFirstBed();
assetPage.clickassetupdatebutton();
facilityLocation.closeNotification();

// delete location
facilityLocation.loadLocationManagementPage("Dummy Shifting Center");
facilityLocation.deleteLocation("Test Location with Beds");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Location Test Location with Beds deleted successfully"
);
facilityLocation.closeNotification();
});

it("Delete location with linked assets", () => {
facilityLocation.clickAddNewLocationButton();
facilityLocation.enterLocationName("Test Location with linked Assets");
facilityLocation.selectLocationType("OTHER");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification("Location created successfully");
facilityLocation.closeNotification();
// create asset and link it to location
cy.awaitUrl("/assets");
assetPage.createAsset();
assetPage.selectFacility("Dummy Shifting Center");
assetPage.selectLocation("Test Location with linked Assets");
assetPage.enterAssetDetails(
"Test Asset linked to Facility",
"Test Description",
"Working",
qr_id_1,
"Manufacturer's Name",
"2025-12-25",
"Customer Support's Name",
phone_number,
"[email protected]",
"Vendor's Name",
serialNumber,
"25122021",
"Test note for asset creation!"
);
assetPage.clickassetupdatebutton();
facilityLocation.loadLocationManagementPage("Dummy Shifting Center");
facilityLocation.deleteLocation("Test Location with linked Assets");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Cannot delete a Location with associated Assets"
);
facilityLocation.closeNotification();

// delete asset
facilityLocation.clickManageAssets();
assetPage.openCreatedAsset();
assetPage.deleteAsset();
facilityLocation.closeNotification();

// delete location
facilityLocation.loadLocationManagementPage("Dummy Shifting Center");
facilityLocation.deleteLocation("Test Location with linked Assets");
assetPage.clickassetupdatebutton();
facilityLocation.verifyNotification(
"Location Test Location with linked Assets deleted successfully"
);
facilityLocation.closeNotification();
});

afterEach(() => {
Expand Down
Loading

0 comments on commit 58b0991

Please sign in to comment.