Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

619 B
Raw Blame
import { render } from '@solidjs/testing-library';
import type { JSX } from 'solid-js';
import { AuthProvider } from '../context/auth-context';
import { createFakeAuth, type FakeAuthWorld } from './fake-auth-context';

/** Render `ui` under a fake auth backend seeded with `world`. */
export function renderWithFakeAuth(
  ui: () => JSX.Element,
  world: Partial<FakeAuthWorld> = {},
  options: Parameters<typeof createFakeAuth>[1] = {}
) {
  const fake = createFakeAuth(world, options);
  const result = render(() => (
    <AuthProvider value={fake.context}>{ui()}</AuthProvider>
  ));
  return { ...result, fake };
}