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 { ChannelDetailSoupDocument } from '@service-storage/graphql/generated/graphql';
import { type FieldNode, Kind, print, visit } from 'graphql';
import { describe, expect, it } from 'vitest';
describe('channel detail document', () => {
it('selects only unread notifications, never the read history', () => {
const edges: FieldNode[] = [];
visit(ChannelDetailSoupDocument, {
Field(node) {
if (node.name.value === 'notifications') edges.push(node);
},
});
expect(edges).toHaveLength(2);
for (const edge of edges) {
const filter = edge.arguments?.find(
(argument) => argument.name.value === 'filter'
);
expect(filter?.value.kind).toBe(Kind.OBJECT);
expect(filter && print(filter.value)).toContain('states: [UNSEEN]');
}
const complete = edges.filter((edge) => !edge.alias);
expect(complete).toHaveLength(1);
expect(
complete[0].arguments?.some((argument) => argument.name.value === 'limit')
).toBe(false);
const filter = complete[0].arguments?.find(
(argument) => argument.name.value === 'filter'
);
expect(filter?.value.kind).toBe(Kind.OBJECT);
expect(filter && print(filter.value)).toBe('{states: [UNSEEN]}');
});
});