Skip to content

Commit

Permalink
Merge branch 'main' into chore/workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj authored Dec 17, 2024
2 parents f5775ec + 8662c92 commit 07a56c4
Show file tree
Hide file tree
Showing 33 changed files with 1,083 additions and 78 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
matrix:
package: [backend, database, frontend, legacy, processor]
steps:
- uses: bcgov-nr/action-builder-ghcr@v2.2.0
- uses: bcgov-nr/action-builder-ghcr@v2.3.0
name: Build (${{ matrix.package }})
with:
package: ${{ matrix.package }}
Expand Down
72 changes: 70 additions & 2 deletions frontend/cypress/e2e/pages/ClientDetailsPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,84 @@ describe("Client Details Page", () => {
family_name: "Baxter",
"cognito:groups": ["CLIENT_VIEWER"],
});

cy.visit("/clients/0");
});

it("renders the page skeleton", () => {
cy.visit("/clients/details/0");

cy.get("cds-breadcrumb").should("contain", "Client search");
cy.contains("h2", "Client summary");
cy.contains("cds-tab", "Client locations");
cy.contains("cds-tab", "Client contacts");
cy.contains("cds-tab", "Related clients");
cy.contains("cds-tab", "Activity log");
});

const nameScenarios = [
{
id: "G",
type: "corporation",
expected: "Kovacek, Thompson And Boyer",
expectedDescription: "Client name",
},
{
id: "I",
type: "individual without middle name",
expected: "John Silver",
expectedDescription: "First name + Last name",
},
{
id: "S",
type: "individual with middle name",
expected: "Michael Gary Scott",
expectedDescription: "First name + Middle name + Last name",
},
];

nameScenarios.forEach((scenario) => {
const { type, id, expected, expectedDescription } = scenario;
describe(`when client is a ${type}`, () => {
beforeEach(() => {
cy.visit(`/clients/details/${id}`);
});
it(`displays the full client name in the header as: ${expectedDescription}`, () => {
cy.contains("h1", expected);
});
});
});

const errorScenarios = [
{
clientId: "enet",
elId: "internalServerError",
description: "a network error",
},
{
clientId: "e400",
elId: "badRequestError",
description: "4xx",
detail: "There seems to be a problem with the information you entered",
},
{
clientId: "e500",
elId: "internalServerError",
description: "5xx",
},
];

errorScenarios.forEach((scenario) => {
const { clientId, elId, description, detail } = scenario;
describe(`when error is ${description}`, () => {
beforeEach(() => {
cy.visit(`/clients/details/${clientId}`);
});
const suffix = detail ? ` with detail "${detail}"` : "";
it(`displays the error message "Something went wrong"${suffix}`, () => {
cy.get(`#${elId}`).should("be.visible");
if (detail) {
cy.get(`#${elId}`).contains(detail);
}
});
});
});
});
4 changes: 2 additions & 2 deletions frontend/cypress/e2e/pages/SearchPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ describe("Search Page", () => {
it("navigates to the client details", () => {
cy.get("@windowOpen").should(
"be.calledWith",
`/clients/${clientNumber}`,
`/clients/details/${clientNumber}`,
"_blank",
"noopener",
);
Expand Down Expand Up @@ -239,7 +239,7 @@ describe("Search Page", () => {
it("navigates to the client details", () => {
cy.get("@windowOpen").should(
"be.calledWith",
`/clients/${clientNumber}`,
`/clients/details/${clientNumber}`,
"_blank",
"noopener",
);
Expand Down
25 changes: 23 additions & 2 deletions frontend/cypress/e2e/pages/SubmissionReviewPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ describe("Submission Review Page", () => {
cy.get("cds-actionable-notification")
.should("not.exist");

cy.get('.grouping-10 > :nth-child(2) > .title-group-01 > .label-01')
cy.get('.grouping-10 > :nth-child(2) > .title-group-01 > .label-02')
.should("contain", "Client number");

cy.get(".grouping-10 > :nth-child(2) > .body-compact-01")
Expand Down Expand Up @@ -364,7 +364,28 @@ describe("Submission Review Page", () => {
});

});


it("displays the birthdate when clientType is Individual", () => {
beforeInit("test-case-review-staff-pending");
cy.contains("h2", "Client summary")
.parent()
.within(() => {
cy.contains("Client type").parents(".grouping-11").first().contains("Individual");
cy.contains("Birthdate").should("be.visible");
});
});

it("displays the birthdate when clientType is Registered sole proprietorship", () => {
beforeInit("test-case-review-rsp");
cy.contains("h2", "Client summary")
.parent()
.within(() => {
cy.contains("Client type")
.parents(".grouping-11")
.first()
.contains("Registered sole proprietorship");
cy.contains("Birthdate").should("be.visible");
});
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ describe("BC Registered Staff Wizard Step", () => {
".read-only-box > cds-inline-notification#readOnlyNotification"
).should("exist");

cy.get(`.read-only-box > #legalType > .title-group-01 > .label-01`)
cy.get(`.read-only-box > #legalType > .title-group-01 > .label-02`)
.should("exist")
.and("have.text", "Type");

Expand All @@ -470,7 +470,7 @@ describe("BC Registered Staff Wizard Step", () => {
.and("have.text", scenario.type);

cy.get(
`.read-only-box > #registrationNumber > .title-group-01 > .label-01`
`.read-only-box > #registrationNumber > .title-group-01 > .label-02`
)
.should("exist")
.and("have.text", "Registration number");
Expand All @@ -493,7 +493,7 @@ describe("BC Registered Staff Wizard Step", () => {
//TODO: check the text and style maybe?!
}

cy.get(`.read-only-box > #goodStanding > .title-group-01 > .label-01`)
cy.get(`.read-only-box > #goodStanding > .title-group-01 > .label-02`)
.should("exist")
.and("have.text", "BC Registries standing");

Expand Down Expand Up @@ -577,17 +577,17 @@ describe("BC Registered Staff Wizard Step", () => {
".read-only-box > cds-inline-notification#readOnlyNotification"
).should("exist");

cy.get(".read-only-box > #legalType > .title-group-01 > .label-01")
cy.get(".read-only-box > #legalType > .title-group-01 > .label-02")
.should("exist")
.and("have.text", "Type");

cy.get(
".read-only-box > #registrationNumber > .title-group-01 > .label-01"
".read-only-box > #registrationNumber > .title-group-01 > .label-02"
)
.should("exist")
.and("have.text", "Registration number");

cy.get(".read-only-box > #goodStanding > .title-group-01 > .label-01")
cy.get(".read-only-box > #goodStanding > .title-group-01 > .label-02")
.should("exist")
.and("have.text", "BC Registries standing");

Expand All @@ -612,15 +612,15 @@ describe("BC Registered Staff Wizard Step", () => {
).should("not.exist");

cy.get(
".read-only-box > #legalType > .title-group-01 > .label-01"
".read-only-box > #legalType > .title-group-01 > .label-02"
).should("not.exist");

cy.get(
".read-only-box > #registrationNumber > .title-group-01 > .label-01"
".read-only-box > #registrationNumber > .title-group-01 > .label-02"
).should("not.exist");

cy.get(
".read-only-box > #goodStanding > .title-group-01 > .label-01"
".read-only-box > #goodStanding > .title-group-01 > .label-02"
).should("not.exist");

cy.get("#workSafeBCNumber").should("not.exist");
Expand Down
57 changes: 57 additions & 0 deletions frontend/cypress/fixtures/test-case-review-rsp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"submissionId": 4444,
"submissionStatus": "Approved",
"submissionType": "Staff submitted data",
"submittedTimestamp": "2024-01-01 00:00:00",
"updateTimestamp": "2024-01-01 00:00:00",
"approvedTimestamp": "2024-01-01 00:00:00",
"updateUser": "CLIADMIN",
"business": {
"businessType": "R",
"registrationNumber": "FM1234567",
"clientNumber": "",
"organizationName": "Dunder Mifflin Paper Company",
"clientType": "RSP",
"clientTypeDesc": "Registered sole proprietorship",
"goodStandingInd": "Y",
"birthdate": "1962-08-17",
"district": null,
"districtDesc": null
},
"contact": [
{
"index": 0,
"contactType": "Billing",
"firstName": "Johnathan",
"lastName": "Wick",
"phoneNumber": "(222) 333-4455",
"emailAddress": "[email protected]",
"locations": [
"Hangar"
],
"userId": "userid"
}
],
"address": [
{
"index": 0,
"streetAddress": "1234 Nowhere St",
"country": "Canada",
"province": "British Columbia",
"city": "Victoria",
"postalCode": "V8V8V8",
"name": "Hangar"
}
],
"matchers": {
"info": {
"name": "Johnathan Wick",
"email": "[email protected]",
"userId": "",
"businessId": "",
"businessName": ""
}
},
"rejectionReason": null,
"confirmedMatchUserId": ""
}
8 changes: 4 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"source-map-support": "^0.5.21",
"start-server-and-test": "^2.0.8",
"ts-node": "^10.9.1",
"typescript": "~5.7.0",
"typescript": "~5.6.0",
"unplugin-icons": "^0.20.0",
"unplugin-vue-components": "^0.27.0",
"vite": "^5.4.10",
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/assets/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,8 @@ cds-actionable-notification * {
gap: 2rem;
padding: 2rem;
flex-wrap: wrap;
width: 100%;
box-sizing: border-box;
}
.grouping-10-internal {
display: flex;
Expand Down Expand Up @@ -1602,6 +1604,10 @@ cds-header-panel[expanded] {
background: var(--light-theme-layer-layer-02, #fff);
}

.no-padding {
padding: 0;
}

// Copied from .cds--side-nav__overlay-active in @carbon/styles/css/styles.css so to make it available on all breakpoints
.overlay-active {
z-index: 6000;
Expand Down Expand Up @@ -1701,7 +1707,7 @@ div.internal-grouping-01 span.body-compact-01 ~ svg.warning path[data-icon-path=
opacity: 1;
}

div.internal-grouping-01:has(svg.warning) span.body-compact-01 {
div.internal-grouping-01:has(svg.warning) span.body-compact-01:not(.default-typography) {
font-weight: 900;
background-color: color-mix(in srgb, var(--cds-support-warning) 40%, white);
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/forms/ReadOnlyComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ defineProps<{ label: string }>()
<template>
<div class="grouping-11">
<div class="title-group-01">
<span class="label-01">{{ label }}</span>
<span class="label-02">{{ label }}</span>
<slot name="icon"></slot>
</div>
</div>
<slot></slot>
</div>
</template>
Expand All @@ -17,4 +17,4 @@ defineProps<{ label: string }>()
flex-direction: row;
gap: 0.5rem;
}
</style>
</style>
29 changes: 29 additions & 0 deletions frontend/src/dto/CommonTypesDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,32 @@ export interface SubmissionDetailsMatchers {
contact: string
location: string
}

export interface ClientDoingBusinessAs {
doingBusinessAsName: string;
}

export interface ClientDetails {
clientNumber: string;
clientName: string;
legalFirstName: string;
legalMiddleName: string;
clientStatusCode: string;
clientStatusDesc: string;
clientTypeCode: string;
clientTypeDesc: string;
clientIdTypeCode: string;
clientIdTypeDesc: string;
clientIdentification: string;
registryCompanyTypeCode: string;
corpRegnNmbr: string;
clientAcronym: string;
wcbFirmNumber: string;
ocgSupplierNmbr: string;
clientComment: string;
clientCommentUpdateDate: string;
clientCommentUpdateUser: string;
goodStandingInd: string;
birthdate: string;
doingBusinessAs: ClientDoingBusinessAs[];
}
Loading

0 comments on commit 07a56c4

Please sign in to comment.