feat(ui): redesign grouped application shell
This commit is contained in:
@@ -47,6 +47,10 @@ async function login(page: Page) {
|
||||
await loginAs(page, "e2e@example.test", "E2ePassword123!");
|
||||
}
|
||||
|
||||
async function loginForApiSetup(page: Page) {
|
||||
expect((await page.request.post(`${apiUrl}/auth/login`, { data: { email: "e2e@example.test", password: "E2ePassword123!" } })).status()).toBe(200);
|
||||
}
|
||||
|
||||
async function csrfHeader(page: Page) {
|
||||
const cookie = (await page.context().cookies()).find((value) => value.name === "XSRF-TOKEN");
|
||||
expect(cookie, "login should issue a CSRF cookie").toBeTruthy();
|
||||
@@ -126,7 +130,7 @@ test("a Free account keeps manual work available while AI actions stay honestly
|
||||
const email = `free-${suffix}@example.test`;
|
||||
const password = "FreeUserPassword123!";
|
||||
|
||||
await login(page);
|
||||
await loginForApiSetup(page);
|
||||
const headers = await csrfHeader(page);
|
||||
const createUser = await page.request.post(`${apiUrl}/users`, {
|
||||
headers,
|
||||
@@ -189,11 +193,12 @@ test("a saved job can be created through the reviewed UI flow", async ({ page })
|
||||
});
|
||||
|
||||
test("the dedicated application workspace survives deep links, long data and unsaved navigation", async ({ page }) => {
|
||||
test.setTimeout(60_000); // API setup and the complete loaded workspace journey exceed 30s on slower hosts.
|
||||
const suffix = Date.now().toString();
|
||||
const companyName = `Application Workspace Company With A Deliberately Long Name ${suffix}`;
|
||||
const title = `Principal Platform Reliability Engineer For Distributed Customer Systems ${suffix}`;
|
||||
|
||||
await login(page);
|
||||
await loginForApiSetup(page);
|
||||
const headers = await csrfHeader(page);
|
||||
let companyResponse = await page.request.post(`${apiUrl}/companies`, {
|
||||
headers,
|
||||
@@ -243,7 +248,7 @@ test("the dedicated application workspace survives deep links, long data and uns
|
||||
const job = await jobResponse.json();
|
||||
|
||||
await page.goto("/jobs");
|
||||
const applicationRow = page.getByRole("row", { name: new RegExp(`Open ${title}`, "i") });
|
||||
const applicationRow = page.locator(`tr[data-job-row-id="${job.id}"]`);
|
||||
await applicationRow.focus();
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(page).toHaveURL(new RegExp(`/jobs/${job.id}$`));
|
||||
@@ -294,7 +299,7 @@ test("the dedicated application workspace survives deep links, long data and uns
|
||||
|
||||
await page.getByRole("button", { name: "Back to applications" }).click();
|
||||
await expect(page).toHaveURL(/\/jobs$/);
|
||||
await expect(page.getByRole("row", { name: new RegExp(`Open ${title}`, "i") })).toBeFocused();
|
||||
await expect(applicationRow).toBeFocused();
|
||||
|
||||
await page.goto("/jobs/2147483647");
|
||||
const missingJobAlert = page.getByRole("alert").filter({ hasText: /Not Found|Could not open this application/i });
|
||||
@@ -387,7 +392,7 @@ test("Career Workspace loads from the authenticated application shell", async ({
|
||||
});
|
||||
|
||||
test("a public CV renders anonymously and downloads as PDF", async ({ page }, testInfo) => {
|
||||
await login(page);
|
||||
await loginForApiSetup(page);
|
||||
const headers = await csrfHeader(page);
|
||||
const create = await page.request.post(`${apiUrl}/cv/variants`, {
|
||||
headers,
|
||||
|
||||
Reference in New Issue
Block a user