intermittent commit

This commit is contained in:
2026-07-14 13:22:10 +02:00
parent 8aa1943581
commit e6f7c45f0a
76 changed files with 6039 additions and 2188 deletions

View File

@@ -13,9 +13,12 @@ function assertDeepEqual(actual: unknown, expected: unknown, message = "values s
}
import { renderToStaticMarkup } from "react-dom/server";
import CredentialPanel from "../src/components/CredentialPanel";
import PasswordField from "../src/components/PasswordField";
import MessageDisplayPanel from "../src/components/MessageDisplayPanel";
import MailServerSettingsPanel from "../src/components/mail/MailServerSettingsPanel";
import EmailAddressInput from "../src/components/email/EmailAddressInput";
import { PlatformLanguageProvider } from "../src/i18n/LanguageContext";
function noop() {}
@@ -31,6 +34,35 @@ const typedPassword = renderToStaticMarkup(
assert(typedPassword.includes('aria-label="i18n:govoplan-core.show_password.044b852f"'), "typed password shows reveal button");
assert(typedPassword.includes("password-field-toggle"), "typed password gets toggle class");
const translatedAddressInput = renderToStaticMarkup(
<PlatformLanguageProvider>
<EmailAddressInput
value={[]}
onChange={noop}
addLabel="i18n:govoplan-core.add_address.a71075c4"
emptyText="i18n:govoplan-core.no_address_added_yet.809c4247"
suggestions={[{ name: "Ada Lovelace", email: "ada@example.local" }]}
/>
</PlatformLanguageProvider>
);
assert(translatedAddressInput.includes("No address added yet"), "email input empty text is translated");
assert(!translatedAddressInput.includes("i18n:govoplan-core.no_address_added_yet.809c4247"), "email input does not leak empty-text i18n key");
assert(translatedAddressInput.includes('aria-label="Type a name and email address, then press Enter"'), "email input aria label is translated");
const savedCredentialPanel = renderToStaticMarkup(
<CredentialPanel
values={{ username: "sender", password: "" }}
onChange={noop}
savedPassword
savedPasswordPlaceholder="Saved credential"
heading="Credentials"
/>
);
assert(savedCredentialPanel.includes("Credentials"), "credential panel renders heading");
assert(savedCredentialPanel.includes('value="sender"'), "credential panel renders username");
assert(savedCredentialPanel.includes('placeholder="Saved credential"'), "credential panel renders saved password placeholder");
assert(!savedCredentialPanel.includes("password-field-toggle"), "saved empty credential does not show reveal button");
const settingsPanel = renderToStaticMarkup(
<MailServerSettingsPanel
smtp={{ host: "smtp.example.org", port: 587, username: "sender", password: "", security: "starttls", timeout_seconds: 30 }}
@@ -142,6 +174,39 @@ const disabledAppendFolderPanel = renderToStaticMarkup(
assert(!disabledAppendFolderPanel.includes("i18n:govoplan-core.folders.c603ab65"), "folder lookup action is hidden when append target is disabled");
assert(!disabledAppendFolderPanel.includes("i18n:govoplan-core.use_detected_folder.5ec4965c"), "detected folder action is hidden when append target is disabled");
const smtpServerOnlyPanel = renderToStaticMarkup(
<MailServerSettingsPanel
visibleSections={["smtp"]}
mode="server"
smtp={{ host: "smtp.example.org", port: 587, username: "sender", password: "", security: "starttls", timeout_seconds: 30 }}
imap={{ host: "imap.example.org", port: 993, username: "reader", password: "", security: "tls", sent_folder: "auto", timeout_seconds: 30 }}
onSmtpChange={noop}
onImapChange={noop}
/>
);
assert(smtpServerOnlyPanel.includes("i18n:govoplan-core.server.cb0cb170"), "focused server panel renders server fields");
assert(!smtpServerOnlyPanel.includes("i18n:govoplan-core.credentials.dd097a22"), "focused server panel hides credential fields");
assert(!smtpServerOnlyPanel.includes("i18n:govoplan-core.mail_server_settings_sections.40a163b7"), "single focused section hides section switcher");
assert(!smtpServerOnlyPanel.includes("imap.example.org"), "focused SMTP server panel does not render IMAP fields");
const imapCredentialsOnlyPanel = renderToStaticMarkup(
<MailServerSettingsPanel
initialSection="imap"
visibleSections={["imap"]}
mode="credentials"
smtp={{ host: "smtp.example.org", port: 587, username: "sender", password: "", security: "starttls", timeout_seconds: 30 }}
imap={{ host: "imap.example.org", port: 993, username: "reader", password: "", security: "tls", sent_folder: "auto", timeout_seconds: 30 }}
onSmtpChange={noop}
onImapChange={noop}
imapPasswordSaved
imapSavedPasswordPlaceholder="Saved IMAP password"
/>
);
assert(imapCredentialsOnlyPanel.includes("i18n:govoplan-core.credentials.dd097a22"), "focused credentials panel renders credential fields");
assert(!imapCredentialsOnlyPanel.includes("i18n:govoplan-core.server.cb0cb170"), "focused credentials panel hides server fields");
assert(imapCredentialsOnlyPanel.includes('placeholder="Saved IMAP password"'), "focused credentials panel preserves saved password UX");
assert(!imapCredentialsOnlyPanel.includes("smtp.example.org"), "focused IMAP credentials panel does not render SMTP fields");
const defaultPortSettingsPanel = renderToStaticMarkup(
<MailServerSettingsPanel
smtp={{ host: "smtp.example.org", security: "starttls" }}