-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix] Nullish coalescing eslint errors (#11651)
* turn rule back on * fix theme provider errors * fix fake data errors * fix date-helper errors * fix theme decorator errors * add strict null checks in playwright * fix form errors * fix i18n errors * fix ui errors * fix web errors * fix strict null types in playwright * fix experience mutations type * fix remaining errors * fix auth token return * fix login-logout test * fix application spec * fix theme decorator * Apply suggestions from code review Co-authored-by: Peter Giles <[email protected]> * fix localized names null fallbacks * ignore boolean primitives * fix theme decorator --------- Co-authored-by: Peter Giles <[email protected]>
- Loading branch information
1 parent
0fa30b3
commit c9416f3
Showing
133 changed files
with
341 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ test.describe("Pool candidates", () => { | |
test.beforeAll(async () => { | ||
const adminCtx = await graphql.newContext(); | ||
|
||
const technicalSkill = await getSkills(adminCtx).then((skills) => { | ||
const technicalSkill = await getSkills(adminCtx, {}).then((skills) => { | ||
return skills.find( | ||
(skill) => skill.category.value === SkillCategory.Technical, | ||
); | ||
|
@@ -59,8 +59,8 @@ test.describe("Pool candidates", () => { | |
skills: { | ||
sync: [ | ||
{ | ||
details: `Test Skill ${technicalSkill.name.en}`, | ||
id: technicalSkill.id, | ||
details: `Test Skill ${technicalSkill?.name.en}`, | ||
id: technicalSkill?.id ?? "", | ||
}, | ||
], | ||
}, | ||
|
@@ -73,18 +73,20 @@ test.describe("Pool candidates", () => { | |
}); | ||
|
||
const createdPool = await createAndPublishPool(adminCtx, { | ||
userId: createdUser.id, | ||
skillId: technicalSkill.id, | ||
userId: createdUser?.id ?? "", | ||
skillId: technicalSkill?.id ?? "", | ||
name: LOCALIZED_STRING, | ||
}); | ||
|
||
const applicantCtx = await graphql.newContext(createdUser.authInfo.sub); | ||
const applicant = await me(applicantCtx); | ||
const applicantCtx = await graphql.newContext( | ||
createdUser?.authInfo?.sub ?? "[email protected]", | ||
); | ||
const applicant = await me(applicantCtx, {}); | ||
|
||
const application = await createAndSubmitApplication(applicantCtx, { | ||
userId: applicant.id, | ||
poolId: createdPool.id, | ||
experienceId: applicant.experiences[0].id, | ||
experienceId: applicant?.experiences?.[0]?.id ?? "", | ||
signature: `${applicant.firstName} signature`, | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ test.describe("User information", () => { | |
let uniqueTestId: string; | ||
let user: User; | ||
let sub: string; | ||
let skill: Skill; | ||
let skill: Skill | undefined; | ||
|
||
const loginAndVisitUser = async ( | ||
appPage: AppPage, | ||
|
@@ -36,7 +36,7 @@ test.describe("User information", () => { | |
}), | ||
).toBeVisible(); | ||
await expect( | ||
page.getByText(new RegExp(user.firstName, "i")).first(), | ||
page.getByText(new RegExp(user?.firstName ?? "", "i")).first(), | ||
).toBeVisible(); | ||
}; | ||
|
||
|
@@ -53,7 +53,7 @@ test.describe("User information", () => { | |
|
||
adminCtx = await graphql.newContext(); | ||
|
||
const technicalSkill = await getSkills(adminCtx).then((skills) => { | ||
const technicalSkill = await getSkills(adminCtx, {}).then((skills) => { | ||
return skills.find((s) => s.category.value === SkillCategory.Technical); | ||
}); | ||
|
||
|
@@ -70,8 +70,8 @@ test.describe("User information", () => { | |
skills: { | ||
sync: [ | ||
{ | ||
details: `Test Skill ${technicalSkill.name.en}`, | ||
id: technicalSkill.id, | ||
details: `Test Skill ${technicalSkill?.name.en}`, | ||
id: technicalSkill?.id ?? "", | ||
}, | ||
], | ||
}, | ||
|
@@ -85,12 +85,12 @@ test.describe("User information", () => { | |
}); | ||
|
||
skill = technicalSkill; | ||
user = createdUser; | ||
user = createdUser ?? { id: "" }; | ||
}); | ||
|
||
test("Applicant cannot access", async ({ appPage }) => { | ||
await loginBySub(appPage.page, "[email protected]", false); | ||
await appPage.page.goto(`/en/admin/users/${user.id}`); | ||
await appPage.page.goto(`/en/admin/users/${user?.id}`); | ||
await appPage.waitForGraphqlResponse("authorizationQuery"); | ||
await expect( | ||
appPage.page.getByRole("heading", { | ||
|
@@ -104,24 +104,24 @@ test.describe("User information", () => { | |
await loginAndVisitUser(appPage, "[email protected]", user); | ||
await assertError(appPage.page); | ||
|
||
const adminUser = await me(adminCtx); | ||
const adminUser = await me(adminCtx, {}); | ||
|
||
const dcmPool = await createAndPublishPool(adminCtx, { | ||
userId: adminUser.id, | ||
name: { | ||
en: `Playwright DCM Pool ${uniqueTestId} (EN)`, | ||
fr: `Playwright DCM Pool ${uniqueTestId} (FR)`, | ||
}, | ||
skillId: skill.id, | ||
skillId: skill?.id ?? "", | ||
}); | ||
|
||
const applicantCtx = await graphql.newContext(sub); | ||
const applicant = await me(applicantCtx); | ||
const applicant = await me(applicantCtx, {}); | ||
await createAndSubmitApplication(applicantCtx, { | ||
userId: applicant.id, | ||
poolId: dcmPool.id, | ||
experienceId: applicant.experiences[0].id, | ||
signature: `${user.firstName} signature`, | ||
experienceId: applicant?.experiences?.[0]?.id ?? "", | ||
signature: `${user?.firstName} signature`, | ||
}); | ||
|
||
// Pool operator can view now that user has application in their pool | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.