Skip to content

Commit 696891b

Browse files
authored
RELEASE: safepeopleregistry-web 2.6.7 (#842)
2 parents a5aa3da + 44f4a93 commit 696891b

35 files changed

Lines changed: 1112 additions & 234 deletions

File tree

.github/workflows/e2e-isolated.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ jobs:
196196
id-token: "write"
197197
steps:
198198
- name: Install MailDev
199-
run: npm install -g maildev
199+
run: npm install -g maildev@2.2.1 # pinned to v2.2.1 because v3.0 changes the API - a future cleanup task will be to update the code to work with v3.0 and remove this pinning
200200

201201
- name: Start MailDev
202202
run: |

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Health Data Research UK
3+
Copyright (c) 2026 Health Data Research UK
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

cypress/support/utils/custodian/manualChecksConfiguration.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ const hasUnCheckedOnUsersConfigurationManualChecks = () => {
55
cy.get('[data-cy="skeleton-checkboxlist"]').should("not.exist", {
66
timeout: 20000,
77
});
8-
cy.get("#13").should("exist").uncheck();
8+
cy.get("#37").should("exist").uncheck();
99
cy.contains(
1010
"p",
1111
"Contact details tab: Location meets project & policy requirements"
1212
).should("exist");
1313
cy.get('[data-cy="action-menu"]')
1414
.find('button[type="button"]')
1515
.should("exist");
16-
cy.get("#14").should("exist").uncheck();
16+
cy.get("#38").should("exist").uncheck();
1717
cy.contains(
1818
"p",
1919
"Projects tab: Previous sensitive data project with us in last 2 years at same affiliation?"
@@ -28,8 +28,8 @@ const hasCheckedOnUsersConfigurationManualChecks = () => {
2828
cy.get('[data-cy="skeleton-checkboxlist"]').should("not.exist", {
2929
timeout: 20000,
3030
});
31-
cy.get("#13").should("exist").check();
32-
cy.get("#14").should("exist").check();
31+
cy.get("#37").should("exist").check();
32+
cy.get("#38").should("exist").check();
3333
};
3434

3535
const addManualChecksForUsersConfigurationManualChecks = (title: string) => {
@@ -130,14 +130,14 @@ const hasUnCheckedOnOrganisationConfigurationManualChecks = () => {
130130
cy.get('[data-cy="skeleton-checkboxlist"]').should("not.exist", {
131131
timeout: 20000,
132132
});
133-
cy.get("#19").should("exist").uncheck();
133+
cy.get("#43").should("exist").uncheck();
134134
cy.contains("span", "Contact details tab: Verify SRO identity").should(
135135
"exist"
136136
);
137137
cy.get('[data-cy="action-menu"]')
138138
.find('button[type="button"]')
139139
.should("exist");
140-
cy.get("#21").should("exist").uncheck();
140+
cy.get("#45").should("exist").uncheck();
141141
cy.contains(
142142
"p",
143143
"Digital identifiers tab: Check validity & type (Public, Private, etc.)"
@@ -152,8 +152,8 @@ const hasCheckedOnOrganisationConfigurationManualChecks = () => {
152152
cy.get('[data-cy="skeleton-checkboxlist"]').should("not.exist", {
153153
timeout: 20000,
154154
});
155-
cy.get("#19").should("exist").check();
156-
cy.get("#21").should("exist").check();
155+
cy.get("#43").should("exist").check();
156+
cy.get("#45").should("exist").check();
157157
};
158158

159159
const hasAddManualChecksForOrganisationConfigurationManualChecks = () => {
@@ -167,7 +167,7 @@ const hasAddManualChecksForOrganisationConfigurationManualChecks = () => {
167167
.within(() => {
168168
cy.contains("button", "Add manual check").click();
169169
});
170-
cy.contains("h3", "Add User manual check").should("exist");
170+
cy.contains("h3", "Add Organisation manual check").should("exist");
171171
cy.contains("label", "Description").should("exist");
172172
cy.contains("button", "Cancel").should("exist");
173173
cy.get("#text").type(text);

cypress/support/utils/custodian/users.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ const hasTrainingandAccreditationsTabCustodianUser = () => {
5353
cy.contains("h2", "Training and Accreditations").should("exist");
5454
cy.contains("h3", "Training history").should("exist");
5555
cy.contains("h3", "Professional membership history").should("exist");
56-
cy.contains(
57-
"p",
58-
"I am a registered Accredited Researcher as published on the UK Statistics Authority website."
59-
).should("exist");
60-
cy.contains(
61-
"p",
62-
"I have signed a User declaration for accessing Digital Economy Act accredited environments."
63-
).should("exist");
64-
cy.get('[data-testid="AccreditedResearcherIcon"]').should("exist");
65-
cy.get('[data-testid="UserDeclarationIcon"]').should("exist");
6656
};
6757

6858
const hasAutomatedFlagsTabCustodianUser = () => {
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import { Accreditation } from "@/types/application";
2+
import { formatShortDate } from "@/utils/date";
3+
import { dataCy } from "../common";
4+
5+
const addAccreditation = (accreditation: Accreditation) => {
6+
cy.buttonClick("Add accreditated research registration");
7+
8+
cy.get(dataCy("form-modal")).should("be.visible");
9+
10+
cy.get("#associated_organisation_name").type(
11+
accreditation.associated_organisation_name
12+
);
13+
cy.get("#id_string").type(accreditation.id_string);
14+
cy.dateSelectValue("issue_date", accreditation.issue_date);
15+
cy.dateSelectValue("expiry_date", accreditation.expiry_date);
16+
17+
cy.saveFormClick();
18+
};
19+
20+
const hasAccreditation = (accreditation: Accreditation) => {
21+
cy.getLatestRowOfResults();
22+
const row = cy.getResultsRowByValue(
23+
accreditation.associated_organisation_name
24+
);
25+
26+
row.within(() => {
27+
cy.contains("td", accreditation.associated_organisation_name);
28+
cy.contains("td", accreditation.id_string);
29+
cy.contains("td", formatShortDate(accreditation.issue_date));
30+
cy.contains("td", formatShortDate(accreditation.expiry_date));
31+
});
32+
};
33+
34+
const editAccreditation = (
35+
accreditation: Accreditation,
36+
updated: Partial<Accreditation>
37+
) => {
38+
cy.getResultsActionMenu(accreditation.associated_organisation_name).click();
39+
40+
cy.actionMenuClick("View or edit");
41+
42+
if (updated.associated_organisation_name) {
43+
cy.get("#associated_organisation_name")
44+
.clear()
45+
.type(updated.associated_organisation_name);
46+
}
47+
48+
if (updated.id_string) {
49+
cy.get("#id_string").clear().type(updated.id_string);
50+
}
51+
52+
cy.saveFormClick();
53+
};
54+
55+
const removeAccreditation = (accreditation: Accreditation) => {
56+
cy.getLatestRowOfResults();
57+
cy.getResultsActionMenu(accreditation.associated_organisation_name).click();
58+
59+
cy.actionMenuClick("Delete");
60+
61+
cy.clickAlertModal("Delete", "Warning");
62+
cy.clickAlertModal("Close");
63+
};
64+
65+
const hasRemovedAccreditation = (accreditation: Accreditation) => {
66+
cy.getResultsRow()
67+
.contains("td", accreditation.associated_organisation_name)
68+
.should("not.exist");
69+
};
70+
71+
export {
72+
addAccreditation,
73+
editAccreditation,
74+
hasRemovedAccreditation,
75+
hasAccreditation,
76+
removeAccreditation,
77+
};

mocks/data/cms.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ReactNode } from "react";
44

55
export const mockedChristmasBannerContent = () => (
66
<>
7-
We wiped this pre-production test site of its data on the week of June 30.
7+
We wiped this pre-production test site of its data on the week of July 23.
88
You will need to re-register an account to continue testing this site. If
99
you contacted us previously, you should receive an email within 24 hours
1010
inviting you or your team back onto the system. Otherwise, if you'd like to

src/app/[locale]/(logged-in)/data-custodian/profile/components/ValidationChecks/ValidationChecks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export default function ValidationChecks() {
244244
rightButton={
245245
isAdmin && (
246246
<AddNewValidationCheck
247-
title={t("userAddTitle")}
247+
title={t("orgAddTitle")}
248248
onSubmit={handleAddOrganisationCheck}
249249
/>
250250
)

src/app/[locale]/(logged-in)/organisation/profile/components/NameAndAddress/NameAndAddress.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { useRouter } from "next/navigation";
2424
import { useEffect, useMemo } from "react";
2525
import useUpdateOrganisation from "../../hooks/useUpdateOrganisation";
2626
import SroFields from "../SroFields";
27+
import OrganisationsParents from "@/organisms/OrganisationsParents";
2728

2829
export interface NameAndAddressFormValues {
2930
organisation_name: string;
@@ -258,6 +259,10 @@ export default function NameAndAddress() {
258259
</Grid>
259260
</Grid>
260261
</PageSection>
262+
<OrganisationsParents
263+
onEditSuccess={() => handleRefetch()}
264+
onDeleteSuccess={() => handleRefetch()}
265+
/>
261266
<OrganisationsSubsidiaries
262267
onEditSuccess={() => handleRefetch()}
263268
onDeleteSuccess={() => handleRefetch()}

src/app/[locale]/(logged-in)/user/profile/components/Trainings/Trainings.test.tsx

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ jest.mock("@/data/store", () => ({
2727

2828
describe("Trainings", () => {
2929
const mockUser = mockedUser({ id: 1 });
30-
const mockUserData = {
31-
data: {
32-
uksa_registered: false,
33-
declaration_signed: false,
34-
},
35-
};
3630

3731
const mockRouter = {
3832
push: jest.fn(),
@@ -43,7 +37,6 @@ describe("Trainings", () => {
4337

4438
mockUseStore({ user: mockUser });
4539
(useQuery as jest.Mock).mockReturnValue({
46-
data: mockUserData,
4740
isLoading: false,
4841
refetch: jest.fn(),
4942
});
@@ -61,42 +54,6 @@ describe("Trainings", () => {
6154
).toBeInTheDocument();
6255
});
6356

64-
it("displays checkboxes", () => {
65-
render(<Trainings />);
66-
const checkboxes = screen.getAllByRole("checkbox");
67-
expect(checkboxes).toHaveLength(2);
68-
});
69-
70-
it("displays 'Find out more' links", () => {
71-
render(<Trainings />);
72-
expect(screen.getAllByText("Find out more")).toHaveLength(2);
73-
});
74-
75-
it("submits form with correct data", async () => {
76-
const mockPutUser = jest.fn();
77-
(useMutation as jest.Mock).mockReturnValue({
78-
mutateAsync: mockPutUser,
79-
isPending: false,
80-
});
81-
82-
render(<Trainings />);
83-
84-
const checkboxes = screen.getAllByRole("checkbox");
85-
fireEvent.click(checkboxes[0]);
86-
fireEvent.click(checkboxes[1]);
87-
88-
await act(async () => {
89-
fireEvent.click(screen.getByText("Finish"));
90-
});
91-
92-
await waitFor(() => {
93-
expect(mockPutUser).toHaveBeenCalledWith({
94-
uksa_registered: true,
95-
declaration_signed: true,
96-
});
97-
});
98-
});
99-
10057
it("navigates to the correct route after submission", async () => {
10158
render(<Trainings />);
10259

@@ -111,33 +68,6 @@ describe("Trainings", () => {
11168
});
11269
});
11370

114-
it("updates form when user data changes", async () => {
115-
const { rerender } = render(<Trainings />);
116-
117-
const checkboxes = screen.getAllByRole("checkbox");
118-
expect(checkboxes[0]).not.toBeChecked();
119-
expect(checkboxes[1]).not.toBeChecked();
120-
121-
(useQuery as jest.Mock).mockReturnValue({
122-
data: {
123-
data: {
124-
...mockUser,
125-
uksa_registered: true,
126-
declaration_signed: true,
127-
},
128-
},
129-
isLoading: false,
130-
});
131-
132-
rerender(<Trainings />);
133-
134-
await waitFor(() => {
135-
const updatedCheckboxes = screen.getAllByRole("checkbox");
136-
expect(updatedCheckboxes[0]).toBeChecked();
137-
expect(updatedCheckboxes[1]).toBeChecked();
138-
});
139-
});
140-
14171
it("has no accessibility violations", async () => {
14272
commonAccessibilityTests(render(<Trainings />));
14373
});

0 commit comments

Comments
 (0)