Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
import { describe, expect, it } from 'vitest';
import { type EmailAccount, orderEmailAccounts } from './email-accounts';
const account = (
address: string,
isPrimary: boolean,
ownerId = 'me'
): EmailAccount => ({ address, isPrimary, ownerId });
describe('orderEmailAccounts', () => {
it('puts the viewer’s own primary inbox first and keeps shared inboxes', () => {
expect(
orderEmailAccounts(
[
account('[email protected]', true, 'someone-else'),
account('[email protected]', false),
account('[email protected]', true),
],
'me'
).map((item) => item.address)
).toEqual(['[email protected]', '[email protected]', '[email protected]']);
});
});