Skip to content

Commit

Permalink
Merge pull request #1328 from DFE-Digital/create-case-delete-button
Browse files Browse the repository at this point in the history
Create case delete button
  • Loading branch information
elielijah321 authored Aug 7, 2024
2 parents d8f84d2 + 0c302b0 commit 51cdcb6
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export const EnvAuthKey = "authKey";
export const CaseworkerClaim = "concerns-casework.caseworker";
export const TeamLeaderClaim = "concerns-casework.teamleader";
export const AdminClaim = "concerns-casework.admin";
export const DeleteCaseGroupClaim = "concerns-casework.case-delete-group";
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { toDisplayDate } from "cypress/support/formatDate";
import { DateIncompleteError, DateInvalidError, NotesError } from "cypress/constants/validationErrorConstants";
import validationComponent from "cypress/pages/validationComponent";
import { DeleteDecisionPage } from "cypress/pages/caseActions/decision/deleteDecisionPage";
import { DeleteCaseGroupClaim } from "cypress/constants/cypressConstants";

describe("User can add decisions to an existing case", () => {
const viewDecisionPage = new ViewDecisionPage();
Expand All @@ -22,7 +23,9 @@ describe("User can add decisions to an existing case", () => {
let now: Date;

beforeEach(() => {
cy.login();
cy.login({
role: DeleteCaseGroupClaim,
});
now = new Date();

cy.basicCreateCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import actionSummaryTable from "cypress/pages/caseActions/summary/actionSummaryT
import { toDisplayDate } from "cypress/support/formatDate";
import { DateIncompleteError, DateInvalidError, NotesError } from "cypress/constants/validationErrorConstants";
import { DeleteFinancialPlanPage } from "cypress/pages/caseActions/financialPlan/DeleteFinancialPlanPage";
import { DeleteCaseGroupClaim } from "cypress/constants/cypressConstants";

describe("User can add Financial Plan case action to an existing case", () => {
let viewFinancialPlanPage = new ViewFinancialPlanPage();
Expand All @@ -17,7 +18,9 @@ describe("User can add Financial Plan case action to an existing case", () => {
let now: Date;

beforeEach(() => {
cy.login();
cy.login({
role: DeleteCaseGroupClaim,
});

now = new Date();
Logger.log("Given a case");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import actionSummaryTable from "cypress/pages/caseActions/summary/actionSummaryT
import { toDisplayDate } from "cypress/support/formatDate";
import {NotesError} from "../../../constants/validationErrorConstants";
import { DeleteNtiUnderConsiderationPage } from "cypress/pages/caseActions/ntiUnderConsideration/deleteNtiUnderConsiderationPage";
import { DeleteCaseGroupClaim } from "cypress/constants/cypressConstants";

describe("Testing the NTI under consideration", () =>
{
Expand All @@ -18,7 +19,9 @@ describe("Testing the NTI under consideration", () =>
let now: Date;

beforeEach(() => {
cy.login();
cy.login({
role: DeleteCaseGroupClaim,
});
now = new Date();

cy.basicCreateCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import actionSummaryTable from "cypress/pages/caseActions/summary/actionSummaryT
import { toDisplayDate } from "cypress/support/formatDate";
import { DateIncompleteError, DateInvalidError, NotesError } from "cypress/constants/validationErrorConstants";
import { DeleteNtiWarningLetterPage } from "cypress/pages/caseActions/ntiWarningLetter/deleteNtiWarningLetterPage";
import { DeleteCaseGroupClaim } from "cypress/constants/cypressConstants";

describe("Testing the NTI warning letter action", () =>
{
Expand All @@ -18,7 +19,9 @@ describe("Testing the NTI warning letter action", () =>
let now;

beforeEach(() => {
cy.login();
cy.login({
role: DeleteCaseGroupClaim,
});
now = new Date();

cy.basicCreateCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
NotesError,
} from "cypress/constants/validationErrorConstants";
import { DeleteNoticeToImprovePage } from "cypress/pages/caseActions/noticeToImprove/deleteNoticeToImprovePage";
import { DeleteCaseGroupClaim } from "cypress/constants/cypressConstants";

describe("Testing case action NTI", () => {
const editNtiPage = new EditNoticeToImprovePage();
Expand All @@ -25,7 +26,9 @@ describe("Testing case action NTI", () => {
let now;

beforeEach(() => {
cy.login();
cy.login({
role: DeleteCaseGroupClaim,
});
now = new Date();

cy.basicCreateCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from "cypress/constants/validationErrorConstants";
import validationComponent from "cypress/pages/validationComponent";
import { DeleteSrmaPage } from "cypress/pages/caseActions/srma/deleteSrmaPage";
import { DeleteCaseGroupClaim } from "cypress/constants/cypressConstants";

describe("Testing the SRMA case action", () => {
const editSrmaPage = new EditSrmaPage();
Expand All @@ -20,7 +21,9 @@ describe("Testing the SRMA case action", () => {
let now: Date;

beforeEach(() => {
cy.login();
cy.login({
role: DeleteCaseGroupClaim,
});
now = new Date();

cy.basicCreateCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from "cypress/constants/validationErrorConstants";
import validationComponent from "cypress/pages/validationComponent";
import { DeleteTrustFinancialForecastPage } from "cypress/pages/caseActions/trustFinancialForecast/deleteTrustFinancialForecastPage";
import { DeleteCaseGroupClaim } from "cypress/constants/cypressConstants";

describe("User can add trust financial forecast to an existing case", () => {
const editTFFPage = new EditTrustFinancialForecastPage();
Expand All @@ -22,7 +23,9 @@ describe("User can add trust financial forecast to an existing case", () => {
let now: Date;

beforeEach(() => {
cy.login();
cy.login({
role: DeleteCaseGroupClaim,
});
now = new Date();
cy.basicCreateCase();
addTFFToCase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { EditSrmaPage } from "cypress/pages/caseActions/srma/editSrmaPage";
import { ViewSrmaPage } from "cypress/pages/caseActions/srma/viewSrmaPage";
import deleteConcernPage from "cypress/pages/deleteConcernPage";
import deleteCasePage from "cypress/pages/deleteCasePage";
import { DeleteCaseGroupClaim } from "cypress/constants/cypressConstants";

describe("Creating a case", () => {
const createCasePage = new CreateCasePage();
Expand All @@ -42,7 +43,9 @@ describe("Creating a case", () => {
describe("Case journey", () =>
{
beforeEach(() => {
cy.login();
cy.login({
role: DeleteCaseGroupClaim,
});
});

it("Should create a case with region group", () => {
Expand Down

0 comments on commit 51cdcb6

Please sign in to comment.