Skip to content

Commit

Permalink
Merge branch 'release/noble-sea-lemon' into chore/CE-1120-add-josh
Browse files Browse the repository at this point in the history
  • Loading branch information
afwilcox authored Oct 21, 2024
2 parents bbba8b4 + 4f34914 commit d54d970
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
56 changes: 56 additions & 0 deletions frontend/cypress/e2e/complaint-search.v2.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,59 @@ describe("Complaint Search Functionality", () => {
});
});
});

/**
* Test that CEEB specific search filters work
*/
describe("Verify CEEB specific search filters work", () => {
beforeEach(function () {
cy.viewport("macbook-16");
cy.kcLogout().kcLogin(Roles.CEEB);
});

function needsDecision() {
let needsDecision = false;
cy.get("#ceeb-decision").then((decisionWrapper) => {
// If the action taken input is on the page, a decision needs to be made
if (decisionWrapper.find("#outcome-decision-action-taken").length > 0) {
needsDecision = true;
}
});
return needsDecision;
}

it.only("allows filtering of complaints by Action Taken", function () {
// Navigate to the complaint list
const complaintWithActionTakenID = "23-030990";
const actionTaken = "Forward to lead agency";

// Check if complaintWithActionTakenID already has a decision.
cy.navigateToDetailsScreen(COMPLAINT_TYPES.ERS, complaintWithActionTakenID, true);
// If the action taken input is available then the complaint does not yet have a decision made on it.
// Set an action taken so that the filter will have results to return.
if (needsDecision()) {
cy.selectItemById("outcome-decision-schedule-sector", "Other");
cy.selectItemById("outcome-decision-sector-category", "None");
cy.selectItemById("outcome-decision-discharge", "Pesticides");
cy.selectItemById("outcome-decision-action-taken", actionTaken);
cy.selectItemById("outcome-decision-lead-agency", "Other");
cy.enterDateTimeInDatePicker("outcome-decision-outcome-date", "01");
// If the complaint is not assigned to anyone, assign it to self
if (cy.get("#comp-details-assigned-officer-name-text-id").contains("Not Assigned")) {
cy.get("#details-screen-assign-button").should("exist").click();
cy.get("#self_assign_button").should("exist").click();
}
cy.get(".modal").should("not.exist"); // Ensure that the quick assign modal has closed
cy.get("#ceeb-decision > .card-body > .comp-details-form-buttons > #outcome-decision-save-button").click();
cy.contains("div", "Decision added").should("exist");
}

// Return to the complaints view
cy.get("#complaints-link").click();

// Filter by action taken
cy.get("#comp-filter-btn").should("exist").click({ force: true });
cy.selectItemById("action-taken-select-id", actionTaken);
cy.get(`#${complaintWithActionTakenID}`).should("exist");
});
});
1 change: 1 addition & 0 deletions migrations/test-only-migrations/R__Test-Data-Creation.sql
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ INSERT INTO public.officer
VALUES('236fb546-fae1-47fd-b4c7-d108c0030ee2'::uuid, 'JGAMACHE', 'FLYWAY', '2024-01-22 22:16:16.754', 'FLYWAY', '2024-01-22 22:20:48.186', '0c002922-d315-4fda-8fc5-3793dac12be8'::uuid, '4a5a94b1-bd47-4611-a577-861d97089903'::uuid, '13D3F179-F4CE-4464-A981-141061FD4E58'::uuid)
ON CONFLICT DO NOTHING;


--------------------------------
--- Scatter our team throughout the province for testing
--- Note that this script runs after the seed data script (which runs in prod) and moves us out of COSH
Expand Down

0 comments on commit d54d970

Please sign in to comment.