feat(ui): migrate Career import review and version history

This commit is contained in:
cesnimda
2026-10-12 19:28:25 +02:00
parent ec23b650f7
commit 5d6e32358c
20 changed files with 10454 additions and 124 deletions
+5 -3
View File
@@ -154,7 +154,7 @@ test("a held Save locks every editor mutation, raw input and history restore unt
expect(snapshot.profile.contact.fullName).toBe("Snapshot owner");
expect(snapshot.cvText).toBe(rawText);
expect(screen.getAllByRole("textbox").filter((field) => !(field as HTMLInputElement).disabled).map((field) => field.getAttribute("aria-label") || field.id)).toEqual([]);
for (const name of [en.profileCvAddLink, en.profileCvStructuredAddLanguage, en.profileCvStructuredAddJob, en.profileCvStructuredAddEducation, en.profileCvStructuredAddOtherSection, en.profileCvVersionRestore]) {
for (const name of [en.profileCvAddLink, en.profileCvStructuredAddLanguage, en.profileCvStructuredAddJob, en.profileCvStructuredAddEducation, en.profileCvStructuredAddOtherSection, en.careerRestoreVersion.replace("{version}", "3")]) {
expect(screen.getByRole("button", { name })).toBeDisabled();
}
for (const button of screen.getAllByRole("button", { name: /^(Remove|Delete custom link|Bold|Italic|Underline|Link$)/ })) expect(button).toBeDisabled();
@@ -218,7 +218,9 @@ test("a failed Save retains a scoped localized error and draft for retry through
await waitFor(() => expect(editor().queryByRole("alert")).not.toBeInTheDocument());
expect(screen.getByLabelText(nb.profileCvContactFullName)).toHaveValue("Beholdt utkast");
expect(screen.queryByText(nb.assetsUnsavedChanges)).not.toBeInTheDocument();
expect(mockedApi.get).toHaveBeenCalledTimes(reads);
expect(mockedApi.get).toHaveBeenCalledTimes(reads + 1);
expect(readCount("/career/profile/versions")).toBe(2);
expect(readCount("/career/profile")).toBe(1);
expect(mockedApi.post).not.toHaveBeenCalled();
});
@@ -269,7 +271,7 @@ test("a read-only provider cannot edit canonical fields or trigger canonical wri
await waitFor(() => expect(screen.getByLabelText(en.profileCvContactFullName)).toHaveValue("Recorded owner"));
fireEvent.click(screen.getByRole("button", { name: /Version history/ }));
expect(screen.getAllByRole("textbox").filter((field) => !(field as HTMLInputElement).disabled)).toEqual([]);
for (const name of [en.profileSaveChanges, en.profileCvVersionRestore, en.profileCvAddLink, en.profileCvStructuredAddLanguage, en.profileCvStructuredAddJob, en.profileCvStructuredAddEducation, en.profileCvStructuredAddOtherSection]) {
for (const name of [en.profileSaveChanges, en.careerRestoreVersion.replace("{version}", "3"), en.profileCvAddLink, en.profileCvStructuredAddLanguage, en.profileCvStructuredAddJob, en.profileCvStructuredAddEducation, en.profileCvStructuredAddOtherSection]) {
const control = screen.getByRole("button", { name });
expect(control).toBeDisabled();
control.click();