Skip to content

Commit

Permalink
bump everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Fbasham committed Nov 1, 2023
1 parent fbd7ff6 commit 7d307d8
Show file tree
Hide file tree
Showing 33 changed files with 2,592 additions and 4,664 deletions.
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Object.defineProperty(nextImage, "default", {
};
} else {
throw new Error(
`Image with src "${props.src}" must use "width" and "height" properties or "layout='fill'" property.`
`Image with src "${props.src}" must use "width" and "height" properties or "layout='fill'" property.`,
);
}

Expand Down
2 changes: 1 addition & 1 deletion components/atoms/Breadcrumb.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ Breadcrumb.propTypes = {
* Link for the breadcrumb
*/
link: PropTypes.string,
})
}),
),
};
2 changes: 1 addition & 1 deletion components/atoms/CheckBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function CheckBox(props) {
props.onChange(
props.uncontrolled ? !e.currentTarget.checked : props.checked,
props.name,
props.value
props.value,
)
}
aria-required={props.required}
Expand Down
2 changes: 1 addition & 1 deletion components/atoms/RadioField.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function RadioField(props) {
props.onChange(
props.uncontrolled ? !e.currentTarget.checked : props.checked,
props.name,
props.value
props.value,
)
}
aria-required={props.required}
Expand Down
2 changes: 1 addition & 1 deletion components/atoms/SelectField.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ SelectField.propTypes = {
id: PropTypes.string.isRequired,
name: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
})
}),
),

/**
Expand Down
2 changes: 1 addition & 1 deletion components/atoms/TextField.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("TextField", () => {
it("renders text field with bold label", () => {
render(<BoldLabel {...BoldLabel.args} />);
expect(screen.getByText(BoldLabel.args.label).classList).toContain(
"font-bold"
"font-bold",
);
});

Expand Down
4 changes: 2 additions & 2 deletions components/design-system/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Footer.propTypes = {
id: PropTypes.string,
text: PropTypes.string,
href: PropTypes.string,
})
}),
),

/**
Expand All @@ -139,6 +139,6 @@ Footer.propTypes = {
key: PropTypes.string,
text: PropTypes.string,
link: PropTypes.string,
})
}),
),
};
2 changes: 1 addition & 1 deletion components/molecules/ErrorBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ErrorBox.propTypes = {
* the text to display for the error component
*/
text: PropTypes.string.isRequired,
})
}),
),
/**
* onClick callback
Expand Down
6 changes: 3 additions & 3 deletions components/molecules/ErrorBox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ describe("ErrorBox", () => {
render(<Primary {...Primary.args} />);
screen.getByText(Primary.args.text);
expect(screen.getByText(Primary.args.errors[0].text).tagName).toBe(
"BUTTON"
"BUTTON",
);
expect(screen.getByText(Primary.args.errors[1].text).tagName).toBe(
"BUTTON"
"BUTTON",
);
expect(screen.getByText(Primary.args.errors[2].text).tagName).toBe(
"BUTTON"
"BUTTON",
);
});

Expand Down
2 changes: 1 addition & 1 deletion components/molecules/FeedbackWidget.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe("FeedbackWidget tests", () => {
it("renders FeedbackWidget in its primary state", () => {
render(<Primary {...Primary.args} />);
expect(screen.getByTestId("feedbackDropdown")).toHaveClass(
"w-auto mx-12 md:mx-24 bg-white shadow-lg border-black border-4"
"w-auto mx-12 md:mx-24 bg-white shadow-lg border-black border-4",
);
});

Expand Down
2 changes: 1 addition & 1 deletion components/molecules/Filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Filter.propTypes = {
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
checked: PropTypes.bool,
})
}),
).isRequired,

/**
Expand Down
2 changes: 1 addition & 1 deletion components/molecules/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ Menu.propTypes = {
* Link for the menu
*/
link: PropTypes.string,
})
}),
).isRequired,
};
4 changes: 2 additions & 2 deletions components/molecules/OptionalListField.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("OptionalListField", () => {

it("renders checkbox list when specified", async () => {
const { container } = render(
<Opened_Checkboxes {...Opened_Checkboxes.args} />
<Opened_Checkboxes {...Opened_Checkboxes.args} />,
);
let elem = screen.getByTestId("reasons-dislike");
expect(elem.type).toEqual("checkbox");
Expand All @@ -58,7 +58,7 @@ describe("OptionalListField", () => {

it("renders radio button list when specified", async () => {
const { container } = render(
<Opened_Radiofields {...Opened_Radiofields.args} />
<Opened_Radiofields {...Opened_Radiofields.args} />,
);
let elem = screen.getByTestId("reasons-dislike");
expect(elem.type).toEqual("radio");
Expand Down
8 changes: 4 additions & 4 deletions components/molecules/TextButtonField.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("TextButtonField", () => {
it("renders the Text field with a button", () => {
render(<Primary {...Primary.args} />);
expect(screen.getByRole("button")).toHaveTextContent(
Primary.args.buttonText
Primary.args.buttonText,
);
});

Expand All @@ -29,22 +29,22 @@ describe("TextButtonField", () => {
it("renders secondary button", () => {
render(<Secondary {...Secondary.args} />);
expect(screen.getByRole("button")).toHaveTextContent(
Secondary.args.buttonText
Secondary.args.buttonText,
);
});

it("renders disabled button", () => {
render(<Disabled {...Disabled.args} />);
expect(screen.getByRole("button")).toHaveTextContent(
Disabled.args.buttonText
Disabled.args.buttonText,
);
expect(screen.getByRole("button")).toHaveAttribute("disabled");
});

it("renders custom button", () => {
render(<Custom {...Custom.args} />);
expect(screen.getByRole("button")).toHaveTextContent(
Custom.args.buttonText
Custom.args.buttonText,
);
});

Expand Down
4 changes: 2 additions & 2 deletions components/organisms/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Footer.propTypes = {
PropTypes.shape({
footerBoxlink: PropTypes.string.isRequired,
footerBoxLinkText: PropTypes.string.isRequired,
})
}),
),
/**
* array of objects containing the link text and link
Expand All @@ -103,7 +103,7 @@ Footer.propTypes = {
PropTypes.shape({
link: PropTypes.string.isRequired,
linkText: PropTypes.string.isRequired,
})
}),
),

/**
Expand Down
2 changes: 1 addition & 1 deletion components/organisms/Footer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ it("renders Footer in its primary state", () => {
render(<Primary {...Primary.args} />);

expect(
screen.getByAltText("Symbol of the Government of Canada")
screen.getByAltText("Symbol of the Government of Canada"),
).toBeTruthy();

Primary.args.footerBoxLinks.forEach((value) => {
Expand Down
2 changes: 1 addition & 1 deletion components/organisms/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Layout.propTypes = {
* Link for the breadcrumb
*/
link: PropTypes.string,
})
}),
),

/**
Expand Down
6 changes: 3 additions & 3 deletions components/organisms/Layout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ describe("Layout", () => {
if (
(typeof args[0] === "string" &&
args[0].includes(
"Warning: An update to %s inside a test was not wrapped in act"
"Warning: An update to %s inside a test was not wrapped in act",
)) ||
args[0].includes(
"Error: Not implemented: navigation (except hash changes)"
"Error: Not implemented: navigation (except hash changes)",
)
) {
return;
Expand Down Expand Up @@ -55,7 +55,7 @@ describe("Layout", () => {
});
await waitFor(() => {
expect(screen.getByTestId("languageLink3").textContent).toEqual(
"English"
"English",
);
});
});
Expand Down
4 changes: 2 additions & 2 deletions components/organisms/ReportAProblem.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export function ReportAProblem(props) {
textFieldName="adaptive_technology_details"
controlLabel={t(
"reportAProblemPageDoesNotWorkWithAdaptiveTechnology",
{ lng: props.language }
{ lng: props.language },
)}
textFieldLabel={t("reportAProblemProvideMoreDetails", {
lng: props.language,
Expand All @@ -270,7 +270,7 @@ export function ReportAProblem(props) {
checkBoxStyle="mb-8 inline-block"
controlValue={t(
"reportAProblemPageDoesNotWorkWithAdaptiveTechnology",
{ lng: props.language }
{ lng: props.language },
)}
/>
<OptionalTextField
Expand Down
2 changes: 1 addition & 1 deletion components/organisms/ReportAProblem.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("Report A Problem", () => {
});
await waitFor(() => {
expect(
screen.getByText("reportAProblemThankYouForYourHelp")
screen.getByText("reportAProblemThankYouForYourHelp"),
).toBeTruthy();
});
});
Expand Down
4 changes: 2 additions & 2 deletions lib/notify/submitEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const submitEmail = async (
templateId,
email,
notifyApiAddress,
notifyApiKey
notifyApiKey,
) => {
const notifyResponse = await fetch(notifyApiAddress, {
method: "POST",
Expand Down Expand Up @@ -37,7 +37,7 @@ export const submitEmailWithAttachment = async (
file,
fileName,
notifyApiAddress,
notifyApiKey
notifyApiKey,
) => {
const notifyResponse = await fetch(notifyApiAddress, {
method: "POST",
Expand Down
2 changes: 1 addition & 1 deletion lib/notify/submitEmail.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("reportAProblem/submitEmail", () => {
"some-template-id",
"[email protected]",
"/v2/notifications/email",
"some-key"
"some-key",

Check failure

Code scanning / CodeQL

Hard-coded credentials Critical

The hard-coded value "some-key" is used as
authorization header
.
);

expect(data[0]).toBe(200);
Expand Down
10 changes: 5 additions & 5 deletions lib/utils/stripFeedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ export function stripFeedback(feedbackToClean) {
//Remove postal code from feedback
feedbackToClean = feedbackToClean.replaceAll(
/[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ -]?\d[ABCEGHJ-NPRSTV-Z]\d/gim,
"### ###"
"### ###",
);

//Remove SIN from feedback
feedbackToClean = feedbackToClean.replaceAll(
/(\d{3}\s*\d{3}\s*\d{3}|\d{3}\D*\d{3}\D*\d{3})/gm,
"### ### ###"
"### ### ###",
);

//Remove email from feedback
feedbackToClean = feedbackToClean.replaceAll(
/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/gim,
"####@####.####"
"####@####.####",
);

//Removes phone number from feedback
feedbackToClean = feedbackToClean.replaceAll(
/(\+\d{1,2}\s?)?1?\-?\.?\s?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}/gm,
"# ### ### ###"
"# ### ### ###",
);
feedbackToClean = feedbackToClean.replaceAll(
/(?:(?:\+?1\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?/gm,
"# ### ### ###"
"# ### ### ###",
);

return feedbackToClean;
Expand Down
2 changes: 1 addition & 1 deletion middlewares/joi.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe("validation middleware tests", () => {
test: Joi.string().email().required(),
}),
mockHandler,
{ abortEarly: false }
{ abortEarly: false },
);
await handler(req, res);
expect(res._getStatusCode()).toEqual(400);
Expand Down
Loading

0 comments on commit 7d307d8

Please sign in to comment.