import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; const webuiDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); const source = fs.readFileSync(path.join(webuiDir, "src/features/mail/MailboxPage.tsx"), "utf8"); const styles = fs.readFileSync(path.join(webuiDir, "src/styles/mail-profiles.css"), "utf8"); function assert(condition, message) { if (!condition) throw new Error(message); } assert(source.includes("IconButton,"), "MailboxPage must import the central IconButton"); assert( source.includes(' setMessageQuery("")}'), "the raw clear-search button must not return" ); assert( !styles.includes(".mailbox-search-field button"), "Mail must not redefine the central icon-button appearance" ); assert( source.includes("isMailboxMessageRead(message.flags)"), "mailbox rows must present provider-derived read/unread state" ); assert( source.includes("mailboxSyncState(messageProvenance)"), "mailbox lists must present synchronization provenance" ); assert( styles.includes(".mailbox-message-row.is-unread") && styles.includes(".mailbox-sync-provenance"), "read state and synchronization provenance must retain focused responsive styling" );