feat(i18n): localise document editing controls
This commit is contained in:
@@ -66,7 +66,12 @@ function routeGet(overrides: Record<string, any> = {}) {
|
||||
});
|
||||
}
|
||||
|
||||
beforeEach(() => jest.clearAllMocks());
|
||||
beforeEach(() => {
|
||||
window.localStorage.removeItem("uiLanguage");
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
afterEach(() => window.localStorage.removeItem("uiLanguage"));
|
||||
|
||||
// ---------- CV ----------
|
||||
|
||||
@@ -185,6 +190,19 @@ test("an empty cover letter offers the template and an empty history", async ()
|
||||
.toContain("Dear Hiring Manager");
|
||||
});
|
||||
|
||||
test("the empty cover-letter template and rich-text controls follow Bokmål UI language", async () => {
|
||||
window.localStorage.setItem("uiLanguage", "nb");
|
||||
routeGet({ coverLetter: { text: null, currentVersion: 0, versions: [], aiSuggestionCount: 0 } });
|
||||
|
||||
render(<ApplicationCoverLetterSection jobId={7} />);
|
||||
|
||||
fireEvent.click(await screen.findByRole("button", { name: /start fra mal/i }));
|
||||
expect((screen.getByLabelText("Søknadsbrev") as HTMLTextAreaElement).value)
|
||||
.toContain("Kjære rekrutteringsansvarlig");
|
||||
expect(screen.getByRole("button", { name: "Fet" })).toBeInTheDocument();
|
||||
expect(screen.getByRole("button", { name: "Lenke" })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("AI cover letter suggestions use the linked CV and require explicit apply", async () => {
|
||||
routeGet();
|
||||
mockedApi.post.mockResolvedValue({
|
||||
|
||||
Reference in New Issue
Block a user