import { setToken } from '../../src/api'

// Stand-in for the full login flow. Tests that need an authenticated request
// call `seedBearer(token)` before the request fires; `clearBearer()` is
// idempotent and runs as a safety net in afterEach (see tests/setup.ts).
export function seedBearer(token = 'test-bearer-default'): string {
  setToken(token)
  return token
}

export function clearBearer(): void {
  setToken(null)
}
