Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update AML supervisory to lower case. Tests update #508

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/services/amlSupervisoryBody/amlBodyService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export class AmlSupervisoryBodyService {
selectedAMLSupervisoryBodies = [];

if (!(selectedAMLSupervisoryBodiesFromForm instanceof Array)) {
selectedAMLSupervisoryBodies.push(selectedAMLSupervisoryBodiesFromForm);
selectedAMLSupervisoryBodies.push(selectedAMLSupervisoryBodiesFromForm.toLowerCase());
} else {
selectedAMLSupervisoryBodies = selectedAMLSupervisoryBodiesFromForm;
selectedAMLSupervisoryBodies = selectedAMLSupervisoryBodiesFromForm.map(body => body.toLowerCase());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes will apply to UI as well. Please check.

}
var amlSupervisoryBodies: Array<AmlSupervisoryBody>;
amlSupervisoryBodies = (!acspData.amlSupervisoryBodies || acspData.amlSupervisoryBodies?.length === 0)
Expand Down
30 changes: 15 additions & 15 deletions test/src/services/amlBodyService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ describe("AmlSupervisoryBodyService", () => {

const requestMock: Partial<Request> = {
body: {
"AML-supervisory-bodies": ["Association of Chartered Certified Accountants (ACCA)", "Association of Accounting Technicians (AAT)"]
"AML-supervisory-bodies": ["association of chartered certified accountants (acca)", "association of accounting technicians (aat)"]
}
};

const amlSupervisoryBodies: Array<AmlSupervisoryBody> = [];
amlSupervisoryBodies.push({
amlSupervisoryBody: "Association of Chartered Certified Accountants (ACCA)"
amlSupervisoryBody: "association of chartered certified accountants (acca)"
},
{
amlSupervisoryBody: "Association of Accounting Technicians (AAT)"
amlSupervisoryBody: "association of accounting technicians (aat)"
});

const acspData: AcspData = {
Expand All @@ -40,13 +40,13 @@ describe("AmlSupervisoryBodyService", () => {

const requestMock: Partial<Request> = {
body: {
"AML-supervisory-bodies": "Association of Chartered Certified Accountants (ACCA)"
"AML-supervisory-bodies": "association of chartered certified accountants (acca)"
}
};

const amlSupervisoryBodiesExpected: Array<AmlSupervisoryBody> = [];
amlSupervisoryBodiesExpected.push({
amlSupervisoryBody: "Association of Chartered Certified Accountants (ACCA)"
amlSupervisoryBody: "association of chartered certified accountants (acca)"
});

const acspData: AcspData = {
Expand All @@ -66,13 +66,13 @@ describe("AmlSupervisoryBodyService", () => {

const requestMock: Partial<Request> = {
body: {
"AML-supervisory-bodies": "Association of Chartered Certified Accountants (ACCA)"
"AML-supervisory-bodies": "association of chartered certified accountants (acca)"
}
};

const amlSupervisoryBodiesExpected: Array<AmlSupervisoryBody> = [];
amlSupervisoryBodiesExpected.push({
amlSupervisoryBody: "Association of Chartered Certified Accountants (ACCA)"
amlSupervisoryBody: "association of chartered certified accountants (acca)"
});

const amlBody1: AmlSupervisoryBody = {
Expand Down Expand Up @@ -102,19 +102,19 @@ describe("AmlSupervisoryBodyService", () => {

const requestMock: Partial<Request> = {
body: {
"AML-supervisory-bodies": "Association of Chartered Certified Accountants (ACCA)",
"AML-supervisory-bodies": "association of chartered certified accountants (acca)",
id: "12345678"
}
};

const amlSupervisoryBodiesExpected: Array<AmlSupervisoryBody> = [];
amlSupervisoryBodiesExpected.push({
amlSupervisoryBody: "Association of Chartered Certified Accountants (ACCA)",
amlSupervisoryBody: "association of chartered certified accountants (acca)",
membershipId: "12345678"
});

const amlBody1: AmlSupervisoryBody = {
amlSupervisoryBody: "Association of Chartered Certified Accountants (ACCA)",
amlSupervisoryBody: "association of chartered certified accountants (acca)",
membershipId: "12345678"
};
const amlBody2: AmlSupervisoryBody = {
Expand All @@ -137,7 +137,7 @@ describe("AmlSupervisoryBodyService", () => {
const amlSupervisoryBodiesExpected: Array<AmlSupervisoryBody> = [];
amlSupervisoryBodiesExpected.push(
{
amlSupervisoryBody: "Association of Chartered Certified Accountants (ACCA)",
amlSupervisoryBody: "association of chartered certified accountants (acca)",
membershipId: "12345678"
},
{
Expand All @@ -147,7 +147,7 @@ describe("AmlSupervisoryBodyService", () => {
);

const amlBody1: AmlSupervisoryBody = {
amlSupervisoryBody: "Association of Chartered Certified Accountants (ACCA)",
amlSupervisoryBody: "association of chartered certified accountants (acca)",
membershipId: "12345678"
};
const amlBody2: AmlSupervisoryBody = {
Expand All @@ -172,17 +172,17 @@ describe("AmlSupervisoryBodyService", () => {

const requestMock: Partial<Request> = {
body: {
"AML-supervisory-bodies": "Association of Chartered Certified Accountants (ACCA)"
"AML-supervisory-bodies": "association of chartered certified accountants (acca)"
}
};

const amlSupervisoryBodiesExpected: Array<AmlSupervisoryBody> = [];
amlSupervisoryBodiesExpected.push({
amlSupervisoryBody: "Association of Chartered Certified Accountants (ACCA)"
amlSupervisoryBody: "association of chartered certified accountants (acca)"
});

const amlBody1: AmlSupervisoryBody = {
amlSupervisoryBody: "Association of Chartered Certified Accountants (ACCA)"
amlSupervisoryBody: "association of chartered certified accountants (acca)"
};

const acspData: AcspData = {
Expand Down