Skip to content

Commit

Permalink
fix web async
Browse files Browse the repository at this point in the history
  • Loading branch information
esizer committed Sep 27, 2024
1 parent 63e35b7 commit 6fc8f76
Show file tree
Hide file tree
Showing 38 changed files with 93 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe("ApplicationCard", () => {
await axeTest(container);
});

it("should have proper action links if the application is in draft", async () => {
it("should have proper action links if the application is in draft", () => {
renderCard({
...defaultProps,
poolCandidateQuery: makeFragmentData(
Expand All @@ -79,7 +79,7 @@ describe("ApplicationCard", () => {
);
});

it("should have proper label and action links if placed/hired in pool", async () => {
it("should have proper label and action links if placed/hired in pool", () => {
renderCard({
...defaultProps,
poolCandidateQuery: makeFragmentData(
Expand Down Expand Up @@ -122,7 +122,7 @@ describe("ApplicationCard", () => {
expect(hiredCasualLabel).toBeInTheDocument();
});

it("should have proper label if the application is draft but the pool is expired", async () => {
it("should have proper label if the application is draft but the pool is expired", () => {
renderCard({
...defaultProps,
poolCandidateQuery: makeFragmentData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { columnStatus } from "./utils";

describe("AssessmentResults", () => {
it("should compute the column status correctly", async () => {
it("should compute the column status correctly", () => {
const notSureStep = applicationScreeningStep;

expect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,7 @@ const ChangeStatusDialog = ({
return Promise.reject(result.error);
};

const submitForm: SubmitHandler<FormValues> = async (
formValues: FormValues,
) => {
const submitForm: SubmitHandler<FormValues> = (formValues: FormValues) => {
// we need to update the original pool candidate, and possibly additional ones from other pools
const poolCandidatesToUpdate = [
selectedCandidate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const EmailVerification = ({
return () => clearTimeout(timerId);
}, [canRequestACode]);

const requestACode = async () => {
const requestACode = () => {
executeSendEmailMutation({
emailType,
})
Expand All @@ -110,7 +110,7 @@ export const EmailVerification = ({
});
};

const submitHandler: SubmitHandler<FormValues> = async (data: FormValues) => {
const submitHandler: SubmitHandler<FormValues> = (data: FormValues) => {
executeVerifyUserEmailMutation({
emailType,
code: data.verificationCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const DisabilityDialog = ({
});
const { handleSubmit } = methods;

const submitHandler: SubmitHandler<FormValues> = async (data: FormValues) => {
const submitHandler: SubmitHandler<FormValues> = (data: FormValues) => {
onSave(data.hasDisability);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const IndigenousDialog = ({
const communities = watch("communities");
const hasCommunitiesSelected = communities && communities.length > 0;

const submitHandler: SubmitHandler<FormValuesWithSignature> = async (
const submitHandler: SubmitHandler<FormValuesWithSignature> = (
data: FormValuesWithSignature,
) => {
const newCommunities = formValuesToApiCommunities(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const VisibleMinorityDialog = ({
});
const { handleSubmit } = methods;

const submitHandler: SubmitHandler<FormValues> = async (data: FormValues) => {
const submitHandler: SubmitHandler<FormValues> = (data: FormValues) => {
onSave(data.isVisibleMinority);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const WomanDialog = ({
});
const { handleSubmit } = methods;

const submitHandler: SubmitHandler<FormValues> = async (data: FormValues) => {
const submitHandler: SubmitHandler<FormValues> = (data: FormValues) => {
onSave(data.isWoman);
};

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Pagination/Pagination.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const assertDotCount = (count: number) => {
describe("Pagination tests", () => {
const user = userEvent.setup();

it("If the total page count is less then page chips show range from 1 to totalPageCount", async () => {
it("If the total page count is less then page chips show range from 1 to totalPageCount", () => {
const props: PaginationProps = {
...defaultProps,
totalCount: 50,
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/PoolCard/PoolCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("PoolCard", () => {
await axeTest(container);
});

it("should render the card", async () => {
it("should render the card", () => {
renderPoolCard({
poolQuery: makeFragmentData(fakedPool, PoolCard_Fragment),
});
Expand All @@ -52,7 +52,7 @@ describe("PoolCard", () => {
);
});

it("should render the null state correctly", async () => {
it("should render the null state correctly", () => {
renderPoolCard({
poolQuery: makeFragmentData(nullPool, PoolCard_Fragment),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("QualifiedRecruitmentCard", () => {
await axeTest(container);
});

it("PLACED_CASUAL and UN-SUSPENDED", async () => {
it("PLACED_CASUAL and UN-SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -89,7 +89,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("PLACED_CASUAL and SUSPENDED", async () => {
it("PLACED_CASUAL and SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -123,7 +123,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("PLACED_INDETERMINATE and UN-SUSPENDED", async () => {
it("PLACED_INDETERMINATE and UN-SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -157,7 +157,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("PLACED_INDETERMINATE and SUSPENDED", async () => {
it("PLACED_INDETERMINATE and SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -191,7 +191,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("PLACED_TERM and UN-SUSPENDED", async () => {
it("PLACED_TERM and UN-SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -225,7 +225,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("PLACED_TERM and SUSPENDED", async () => {
it("PLACED_TERM and SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -259,7 +259,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("QUALIFIED_AVAILABLE and UN-SUSPENDED", async () => {
it("QUALIFIED_AVAILABLE and UN-SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand All @@ -284,7 +284,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(3);
});

it("QUALIFIED_AVAILABLE and SUSPENDED", async () => {
it("QUALIFIED_AVAILABLE and SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand All @@ -311,7 +311,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(3);
});

it("QUALIFIED_UNAVAILABLE and UN-SUSPENDED", async () => {
it("QUALIFIED_UNAVAILABLE and UN-SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -345,7 +345,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("QUALIFIED_UNAVAILABLE and SUSPENDED", async () => {
it("QUALIFIED_UNAVAILABLE and SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -379,7 +379,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("QUALIFIED_WITHDREW and UN-SUSPENDED", async () => {
it("QUALIFIED_WITHDREW and UN-SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -413,7 +413,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("QUALIFIED_WITHDREW and SUSPENDED", async () => {
it("QUALIFIED_WITHDREW and SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -447,7 +447,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("EXPIRED and UN-SUSPENDED", async () => {
it("EXPIRED and UN-SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down Expand Up @@ -481,7 +481,7 @@ describe("QualifiedRecruitmentCard", () => {
expect(buttons).toHaveLength(2);
});

it("EXPIRED and SUSPENDED", async () => {
it("EXPIRED and SUSPENDED", () => {
renderCard({
...defaultProps,
candidateQuery: makeFragmentData(
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const createRoute = (locale: Locales) =>
},
{
path: "dashboard",
loader: async () => {
loader: () => {
throw new Response("Not Found", { status: 404 }); // unfinished page
},
lazy: () =>
Expand Down Expand Up @@ -124,7 +124,7 @@ const createRoute = (locale: Locales) =>
},
{
path: "logged-out",
loader: async () => {
loader: () => {
const overridePath = sessionStorage.getItem(
POST_LOGOUT_OVERRIDE_PATH_KEY,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe("SearchRequestsTable", () => {
await axeTest(container);
});

it("Should render the table", async () => {
it("Should render the table", () => {
renderSearchRequestsTable();

// Assert table filled with values and the result of requests[0] is present
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/ThemeSwitcher/ThemeSwitcher.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("ThemeSwitcher", () => {
jest.spyOn(Object.getPrototypeOf(window.localStorage), "setItem");
Object.setPrototypeOf(window.localStorage.setItem, jest.fn());

it("should change theme to light mode", async () => {
it("should change theme to light mode", () => {
renderThemeSwitcher();
fireEvent.click(
screen.getByRole("radio", { name: /activate light mode/i }),
Expand All @@ -42,7 +42,7 @@ describe("ThemeSwitcher", () => {
).toHaveAttribute("data-state", "on");
});

it("should change theme to dark mode", async () => {
it("should change theme to dark mode", () => {
renderThemeSwitcher();
fireEvent.click(screen.getByRole("radio", { name: /activate dark mode/i }));

Expand All @@ -59,7 +59,7 @@ describe("ThemeSwitcher", () => {
).toHaveAttribute("data-state", "on");
});

it("should change theme to pref mode", async () => {
it("should change theme to pref mode", () => {
renderThemeSwitcher();
fireEvent.click(
screen.getByRole("radio", {
Expand Down
Loading

0 comments on commit 6fc8f76

Please sign in to comment.