@ministryofjustice/hmpps-probation-integration-e2e-tests 1.211.0 → 1.213.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ministryofjustice/hmpps-probation-integration-e2e-tests",
3
3
  "description": "Playwright end to end tests for hmpps-probation-integration-services.",
4
- "version": "1.211.0",
4
+ "version": "1.213.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ministryofjustice/hmpps-probation-integration-e2e-tests#readme",
7
7
  "bugs": {
@@ -31,7 +31,7 @@
31
31
  "eslint-config-prettier": "^10.0.1",
32
32
  "eslint-plugin-prettier": "^5.2.1",
33
33
  "prettier": "3.8.3",
34
- "tsdown": "^0.21.0"
34
+ "tsdown": "^0.22.0"
35
35
  },
36
36
  "exports": {
37
37
  "./steps/accredited-programmes/application": "./steps/accredited-programmes/application.mjs",
@@ -143,6 +143,7 @@
143
143
  "./steps/delius/upw/create-upw-appointment": "./steps/delius/upw/create-upw-appointment.mjs",
144
144
  "./steps/delius/upw/create-upw-project": "./steps/delius/upw/create-upw-project.mjs",
145
145
  "./steps/delius/upw/start-upw-assessment": "./steps/delius/upw/start-upw-assessment.mjs",
146
+ "./steps/delius/upw/verify-adjustment": "./steps/delius/upw/verify-adjustment.mjs",
146
147
  "./steps/delius/upw/verify-time-credited": "./steps/delius/upw/verify-time-credited.mjs",
147
148
  "./steps/delius/utils/contact": "./steps/delius/utils/contact.mjs",
148
149
  "./steps/delius/utils/date-time": "./steps/delius/utils/date-time.mjs",
@@ -1,7 +1,7 @@
1
1
  import { Yesterday } from "../../delius/utils/date-time.mjs";
2
2
  import { getToken } from "../auth/get-token.mjs";
3
- import { retry, sanitiseError } from "../utils/api-utils.mjs";
4
3
  import { setNomisId } from "../../delius/offender/update-offender.mjs";
4
+ import { retry, sanitiseError } from "../utils/api-utils.mjs";
5
5
  import { request } from "@playwright/test";
6
6
  import { DateTime } from "luxon";
7
7
  import { faker } from "@faker-js/faker";
@@ -6,7 +6,7 @@ declare function recordAttendanceCompliedOutcome(page: Page, startTime?: string,
6
6
  declare function recordUnacceptableAbsenceOutcome(page: Page): Promise<void>;
7
7
  declare function adjustTravelTime(page: Page, hours: string, minutes: string): Promise<void>;
8
8
  declare function findGroupSession(page: Page, crn: string, person: Person, projectName: string, provider: string, teamName: string): Promise<void>;
9
- declare function findPlacementsWithHostPartner(page: Page, provider: string, teamName: string): Promise<string>;
10
- declare function recordSessionAttendance(page: Page, startTime: string, endTime: string): Promise<string>;
9
+ declare function findPlacementsWithHostPartner(page: Page, provider: string, teamName: string): Promise<string | null>;
10
+ declare function recordSessionAttendance(page: Page, startTime: string, endTime: string): Promise<string | null>;
11
11
  //#endregion
12
12
  export { adjustTravelTime, findGroupSession, findPlacementsWithHostPartner, recordAttendanceCompliedOutcome, recordSessionAttendance, recordUnacceptableAbsenceOutcome };
@@ -32,7 +32,7 @@ declare const hearingData: (person: Person, address?: Address, court?: {
32
32
  id: string;
33
33
  defendants: {
34
34
  id: `${string}-${string}-${string}-${string}-${string}`;
35
- pncId: string;
35
+ pncId: string | undefined;
36
36
  prosecutionCaseId: string;
37
37
  personDefendant: {
38
38
  personDetails: {
@@ -49,7 +49,7 @@ declare const hearingData: (person: Person, address?: Address, court?: {
49
49
  work: string;
50
50
  mobile: string;
51
51
  };
52
- dateOfBirth: string;
52
+ dateOfBirth: string | null;
53
53
  firstName: string;
54
54
  gender: string;
55
55
  lastName: string;
@@ -6,7 +6,7 @@ import { Page } from "@playwright/test";
6
6
  declare function findOffenderByName(page: Page, forename: string, surname: string): Promise<void>;
7
7
  declare function findOffenderByCRN(page: Page, crn: string): Promise<void>;
8
8
  declare function findOffenderByCRNNoContextCheck(page: Page, crn: string): Promise<void>;
9
- declare function findFirstOffender(page: Page, person: Person, provider: string): Promise<string>;
9
+ declare function findFirstOffender(page: Page, person: Person, provider: string): Promise<string | null | undefined>;
10
10
  declare function findOffenderByNomisId(page: Page, nomisId: string): Promise<string>;
11
11
  declare function verifyAllocation(page: Page, args: {
12
12
  allocation: Allocation;
@@ -0,0 +1,17 @@
1
+ import { Page } from "@playwright/test";
2
+
3
+ //#region steps/delius/upw/verify-adjustment.d.ts
4
+ interface Options {
5
+ crn: string;
6
+ eventNumber?: number;
7
+ reason: string;
8
+ hoursCredited: string;
9
+ }
10
+ declare function verifyAdjustment(page: Page, {
11
+ crn,
12
+ eventNumber,
13
+ reason,
14
+ hoursCredited
15
+ }: Options): Promise<void>;
16
+ //#endregion
17
+ export { verifyAdjustment as default };
@@ -0,0 +1,16 @@
1
+ import { waitForAjax } from "../utils/refresh.mjs";
2
+ import { findEventByCRN } from "../event/find-events.mjs";
3
+ import { verifyTableRowByContent } from "../utils/table.mjs";
4
+ //#region steps/delius/upw/verify-adjustment.ts
5
+ async function verifyAdjustment(page, { crn, eventNumber = 1, reason, hoursCredited }) {
6
+ await findEventByCRN(page, crn, eventNumber);
7
+ await page.click("#navigation-include\\:linkNavigation3UnpaidWork");
8
+ await page.getByRole("button", { name: "Adjustment" }).click();
9
+ await waitForAjax(page);
10
+ await verifyTableRowByContent(page, "currentAdjustmentsTable", reason, [{
11
+ columnName: "Adjustment",
12
+ cellContent: hoursCredited
13
+ }]);
14
+ }
15
+ //#endregion
16
+ export { verifyAdjustment as default };
@@ -2,7 +2,7 @@ import { Page } from "@playwright/test";
2
2
 
3
3
  //#region steps/referandmonitor/referral.d.ts
4
4
  declare const referralProgress: (page: Page, referralRef: string) => Promise<void>;
5
- declare const makeReferral: (page: Page, crn: string) => Promise<string>;
5
+ declare const makeReferral: (page: Page, crn: string) => Promise<string | null>;
6
6
  declare const assignReferral: (page: Page, referralRef: string) => Promise<void>;
7
7
  declare const withdrawReferral: (page: Page, referralRef: string) => Promise<void>;
8
8
  //#endregion