, context: AppContextValue) {
return render(
);
}
function LocationProbe() {
const location = useLocation();
return {location.pathname}{location.search}
;
}
function accessEntry(): AdminMailboxAccessEntry {
const mailbox = mailboxFixture(10, 'support@example.test', 'owner', { view: true, receive: true, send: true }, 1);
return {
mailbox,
owner: adminUsers[0],
grants: [{
user: adminUsers[1],
permissions: { view: true, receive: true, send: false },
createdAt: '2026-07-18T00:00:00.000Z',
updatedAt: '2026-07-18T00:00:00.000Z'
}]
};
}
function mailboxFixture(
id: number,
address: string,
type: MailboxAccessType,
permissions: MailboxPermissions,
ownerUserId: number
): InboundMailbox {
const [, domain] = address.split('@');
return {
id,
userId: ownerUserId,
ownerUserId,
domainId: id,
domain,
address,
localPart: address.split('@')[0],
displayName: '',
aliases: [],
forwardTo: [],
keepForwarded: true,
quotaMb: 1024,
passwordSet: true,
passwordRecoverable: false,
status: 'active',
messageCount: permissions.receive ? 3 : null,
unreadCount: permissions.receive ? 1 : null,
lastMessageAt: permissions.receive ? '2026-07-18T00:00:00.000Z' : null,
access: { type, permissions },
createdAt: '2026-07-18T00:00:00.000Z',
updatedAt: '2026-07-18T00:00:00.000Z'
};
}
const adminUsers: AdminUser[] = [
{ id: 1, username: 'owner', email: 'owner@example.test', role: 'admin', status: 'active', resourceCounts: resourceCounts() },
{ id: 2, username: 'reader', email: 'reader@example.test', role: 'user', status: 'active', resourceCounts: resourceCounts() }
];
function contextFor(user: User): AppContextValue {
return {
user,
config,
refreshBootstrap: vi.fn(async () => undefined),
logout: vi.fn(async () => undefined)
};
}
function resourceCounts() {
return { domains: 0, dnsCredentials: 0, apiTokens: 0, inboundMailboxes: 0, inboundMessages: 0, sendEvents: 0, smtpCredential: 0 };
}
const config: RuntimeConfig = {
appBaseUrl: 'https://mail.example.test',
webmailSsoEnabled: true,
mailHostname: 'mail.example.test',
sendingIp: '192.0.2.10',
defaultSpfMechanisms: '',
dmarcPolicy: 'none',
dmarcRua: '',
registrationRequiresApproval: false,
sendRequiresVerified: true,
engagementTrackingEnabled: true,
listUnsubscribeMailto: '',
listUnsubscribeUrl: '',
listUnsubscribePostEnabled: false,
feedbackIdEnabled: false,
reportAbuseTo: '',
csaComplaintsTo: '',
bounceAddress: '',
bounceEnvelopeEnabled: false
};
const adminContext: AppContextValue = contextFor(adminUsers[0]);
const userContext: AppContextValue = contextFor({ id: 2, username: 'reader', email: 'reader@example.test', role: 'user', status: 'active' });