import type { Page } from "@playwright/test";

import { apiEnvelope } from "../data/common";
import { chatCharactersResponse } from "../data/character";

export async function registerCharacterMocks(page: Page) {
  await page.route(/\/api\/characters(?:\?.*)?$/, async (route) => {
    await route.fulfill({ json: apiEnvelope(chatCharactersResponse) });
  });
}
