Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

748 B
Raw Blame
import { describe, expect, it, vi } from 'vitest';
import { up } from './006-stacker-news-existing-key-accounts-keep-api-reads.js';

describe('Stacker News existing-key read transport migration', () => {
  it('pins only credential-bearing accounts to API reads, leaving keyless ones on the browser default', async () => {
    const query = vi.fn(async () => ({ rows: [] }));
    await up({ query });
    const [sql] = query.mock.calls[0];
    expect(sql).toContain("SET read_transport='api'");
    expect(sql).toContain('FROM stacker_news_credentials');
    // Scoped to the default so a re-run (or a later user choice) cannot undo an
    // explicit switch back to browser reads.
    expect(sql).toContain("a.read_transport='browser'");
  });
});