amczuboka / Decagon-CondoManagementSystem

Condo Management System
3 stars 3 forks source link

#75 cypress new building operation #205

Closed IsabelleCzuboka closed 5 months ago

IsabelleCzuboka commented 5 months ago

This cypress test is about adding a new operation to a building. I created a function to delete an operation so that the test may run multiple times without fault.

closes #75

amczuboka commented 5 months ago

I think it would be better to delete the operation by ID to ensure it is unique and we don't accidentally delete an operation with the same name.

I don't think this is an issue, because it's only being used in a cypress test. If we wanted to delete it by ID, we would have to delete every operation anyway since there's no way to get the specific operation. For example, in the createBuilding.cy test it deletes every building of the user even if it only created 1 building

 const promiseDelete = user.PropertyIds.map(async (ID) => {
        await(win as any).buildingService.deleteBuilding(ID);
  });
KarinaSandur commented 5 months ago

I think it would be better to delete the operation by ID to ensure it is unique and we don't accidentally delete an operation with the same name.

I don't think this is an issue, because it's only being used in a cypress test. If we wanted to delete it by ID, we would have to delete every operation anyway since there's no way to get the specific operation. For example, in the createBuilding.cy test it deletes every building of the user even if it only created 1 building

 const promiseDelete = user.PropertyIds.map(async (ID) => {
        await(win as any).buildingService.deleteBuilding(ID);
  });

If that's the case, then I'll approve

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud