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

[Debt] Removes teams from UI #12328

Merged
merged 35 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
156c916
Remove Teams pages from admin UI
mnigh Dec 13, 2024
ba660b8
Remove Teams pages from Router
mnigh Dec 13, 2024
eefe3c3
Remove TeamRoleTable
mnigh Dec 13, 2024
2e74dd1
Remove teams from NavMenu
mnigh Dec 13, 2024
0a66317
Remove teamTable route
mnigh Dec 13, 2024
2a89fd6
Remove teamCreate route
mnigh Dec 13, 2024
b52b777
Remove teamMembers route
mnigh Dec 13, 2024
902d456
Remove teamUpdate route
mnigh Dec 13, 2024
3bac0ee
Remove teamView route
mnigh Dec 13, 2024
0613ab1
Remove AddTeamRoleDialog
mnigh Dec 13, 2024
be8cf14
Remove EditTeamRoleDialog
mnigh Dec 13, 2024
e76ce9c
Remove RemoveTeamRoleDialog
mnigh Dec 13, 2024
104e0f3
Remove helper functions
mnigh Dec 13, 2024
5566445
Merge branch 'main' into 10368-remove-teams-ui
mnigh Dec 16, 2024
9ca940f
Remove team select
mnigh Dec 17, 2024
78fd8e5
Remove orphan strings
mnigh Dec 17, 2024
f0d22db
Update snapshot
mnigh Dec 17, 2024
f056459
Remove Teams from jest tests
mnigh Dec 17, 2024
1132ffa
Remove Title for the index team page
mnigh Dec 17, 2024
3ada25b
Remove Teams from playwright tests
mnigh Dec 17, 2024
f9e382a
Merge branch 'main' into 10368-remove-teams-ui
mnigh Dec 17, 2024
94ee2bc
Add communityAdmin role to [email protected] user
mnigh Dec 18, 2024
1001956
Add teamIdForRoleAssignment
mnigh Dec 18, 2024
f2f1f1f
Refactor createPool
mnigh Dec 18, 2024
edeae45
Merge branch 'main' into 10368-remove-teams-ui
mnigh Dec 19, 2024
ee96031
Update test to account for being slow
mnigh Dec 19, 2024
3930b82
Remove paths that no longer exist
mnigh Dec 19, 2024
7cdb039
Remove TeamPage class
mnigh Dec 19, 2024
e56150d
Refactor process permissions spec
mnigh Dec 20, 2024
e2b217f
Remove getDCM
mnigh Dec 20, 2024
72317fa
Merge branch 'main' into 10368-remove-teams-ui
mnigh Dec 20, 2024
0682be4
Remove Pool operator access test
mnigh Dec 20, 2024
57a58b6
Add timeout
mnigh Dec 23, 2024
b68274f
Split process files into create, update, delete
mnigh Dec 24, 2024
17b7152
Merge branch 'main' into 10368-remove-teams-ui
mnigh Dec 27, 2024
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
1 change: 1 addition & 0 deletions api/database/seeders/UserTestSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function run()
->asApplicant()
->asRequestResponder()
->asCommunityManager()
->asCommunityAdmin([$digitalCommunityId, $atipCommunityId])
->asAdmin()
->asPoolOperator(['digital-community-management', 'office-of-indigenous-initiatives'])
->withSkillsAndExperiences()
Expand Down
14 changes: 0 additions & 14 deletions apps/playwright/fixtures/TeamPage.ts

This file was deleted.

3 changes: 0 additions & 3 deletions apps/playwright/tests/admin/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ test.describe("Authenticated", () => {
"/en/admin/settings/skill-families",
"/en/admin/talent-requests",
"/en/admin/communities",
"/en/admin/teams",
];

const processOperatorAllowedPaths = [
Expand Down Expand Up @@ -221,7 +220,6 @@ test.describe("Authenticated", () => {
"/en/admin/settings/departments",
"/en/admin/settings/skills",
"/en/admin/settings/skill-families",
"/en/admin/teams",
];

const communityRecruiterAllowedPaths = [
Expand Down Expand Up @@ -275,7 +273,6 @@ test.describe("Authenticated", () => {
"/en/admin/settings/departments",
"/en/admin/settings/skills",
"/en/admin/settings/skill-families",
"/en/admin/teams",
];

const communityAdminAllowedPaths = [
Expand Down
117 changes: 117 additions & 0 deletions apps/playwright/tests/admin/process-action-create.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import { test, expect } from "~/fixtures";
import { loginBySub } from "~/utils/auth";

const UPDATE_MUTATION = "UpdatePool";

const uniqueTestId = Date.now().valueOf();
const PROCESS_TITLE = `Test process ${uniqueTestId}`;

test("Create pool", async ({ appPage }) => {
await loginBySub(appPage.page, "[email protected]");
await appPage.page.goto("/en/admin/pools");
await appPage.waitForGraphqlResponse("PoolTable");

await appPage.page.getByRole("link", { name: /create process/i }).click();
await appPage.waitForGraphqlResponse("CreatePoolPage");

await appPage.page
.getByRole("combobox", { name: /group and level/i })
.selectOption({ label: "IT-01 (Information Technology)" });

await appPage.page
.getByRole("combobox", { name: /department/i })
.selectOption({ label: "Treasury Board Secretariat" });

await appPage.page
.getByRole("combobox", { name: /community/i })
.selectOption({ label: "Digital Community" });

await appPage.page.getByRole("button", { name: /create process/i }).click();
await appPage.waitForGraphqlResponse("CreatePool");
await expect(appPage.page.getByRole("alert")).toContainText(
/recruitment process created successfully/i,
);
await appPage.waitForGraphqlResponse("EditPoolPage");
await appPage.waitForGraphqlResponse("CoreRequirementOptions");
await expect(
appPage.page.getByRole("heading", {
name: /advertisement information/i,
}),
).toBeVisible();

// Update basic information section
await appPage.page
.getByRole("button", { name: /edit advertisement details/i })
.click();

await appPage.page
.getByRole("combobox", { name: /classification/i })
.selectOption({ label: "IT-04 (Information Technology)" });

await appPage.page
.getByRole("textbox", { name: /job title \(en\)/i })
.fill(`${PROCESS_TITLE} (EN)`);

await appPage.page
.getByRole("textbox", { name: /job title \(fr\)/i })
.fill(`${PROCESS_TITLE} (FR)`);

await appPage.page
.getByRole("combobox", { name: /length of opportunity/i })
.selectOption({ label: "Various" });

await appPage.page
.getByRole("combobox", { name: /publishing group/i })
.selectOption({ label: "Other" });

await appPage.page
.getByRole("button", { name: /save advertisement details/i })
.click();
await appPage.waitForGraphqlResponse(UPDATE_MUTATION);
await expect(appPage.page.getByRole("alert").last()).toContainText(
/process updated successfully/i,
);

// Update closing date
await appPage.page
.getByRole("button", { name: /edit closing date/i })
.click();

const closingDate = appPage.page.getByRole("group", {
name: /end date/i,
});
await closingDate.getByRole("spinbutton", { name: /year/i }).fill("2500");
await closingDate
.getByRole("combobox", { name: /month/i })
.selectOption("01");
await closingDate.getByRole("spinbutton", { name: /day/i }).fill("1");

await appPage.page
.getByRole("button", { name: /save closing date/i })
.click();
await appPage.waitForGraphqlResponse(UPDATE_MUTATION);
await expect(appPage.page.getByRole("alert").last()).toContainText(
/process updated successfully/i,
);

// Update core requirements
await appPage.page
.getByRole("button", { name: /edit core requirements/i })
.click();

await appPage.page
.getByRole("combobox", { name: /language requirement/i })
.selectOption({ label: "Bilingual intermediate (B B B)" });

await appPage.page
.getByRole("combobox", { name: /security requirement/i })
.selectOption({ label: "Reliability or higher" });

await appPage.page
.getByRole("button", { name: /save core requirements/i })
.click();
await appPage.waitForGraphqlResponse(UPDATE_MUTATION);
await expect(appPage.page.getByRole("alert").last()).toContainText(
/process updated successfully/i,
);
});
30 changes: 30 additions & 0 deletions apps/playwright/tests/admin/process-action-delete.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { test, expect } from "~/fixtures";
import { loginBySub } from "~/utils/auth";
import graphql from "~/utils/graphql";
import { createPool } from "~/utils/pools";
import { me } from "~/utils/user";

test("Delete pool", async ({ appPage }) => {
const adminCtx = await graphql.newContext();

const user = await me(adminCtx, {});

const createdPool = await createPool(adminCtx, {
userId: user.id,
});

await loginBySub(appPage.page, "[email protected]");
await appPage.page.goto(`/en/admin/pools/${createdPool.id}`);
await appPage.waitForGraphqlResponse("ViewPoolPage");

await appPage.page.getByRole("button", { name: /delete/i }).click();
const deleteDialog = appPage.page.getByRole("dialog", {
name: /delete/i,
});
await deleteDialog.getByRole("button", { name: /delete/i }).click();

await appPage.waitForGraphqlResponse("DeletePool");
await expect(appPage.page.getByRole("alert").last()).toContainText(
/process deleted successfully/i,
);
});
Loading
Loading