Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
emyl3 committed Oct 13, 2023
1 parent 6307cda commit ce3f149
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions cypress/utils/setup-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@ const archivePatients = (resData) => {
}
})
}

const ghostIntoOrganization = () => {
cy.task("getSpecName")
.then((res) => getOrganizationByName(`${res}-org`))
.then((res) => accessOrganization(res.body.data.organization.externalId))
}
export const setupOrgAndFacility = () => {
cy.task("getSpecName")
.then((res) => getOrganizationByName(`${res}-org`))
.then((res) => createOrUnDeleteOrg(res.body.data.organization))
.then(() => cy.task("getSpecName"))
.then((res) => getOrganizationByName(`${res}-org`))
.then((res) => accessOrganization(res.body.data))
.then(() => ghostIntoOrganization())
.then((res) => addOrUnarchiveFacility(res.body.data.setCurrentUserTenantDataAccess.organization.facilities))
.then((res) => archivePatients(res.body.data))
};
2 changes: 1 addition & 1 deletion cypress/utils/testing-data-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const accessOrganization = (orgExternalId) => {
return cy.makePOSTRequest({
operationName: "SetCurrentUserTenantDataAccess",
variables: {
organizationExternalId: orgExternalId.organization.externalId,
organizationExternalId: orgExternalId,
},
query: `mutation SetCurrentUserTenantDataAccess(
$organizationExternalId: String!
Expand Down

0 comments on commit ce3f149

Please sign in to comment.