import { expect } from "@playwright/test";
import { apiRequest } from "./api.js";
import { expectId, readJsonSafe } from "./generalFixtures.js";
async function createFeatureToggleFixture(request, token, data) {
  const response = await apiRequest(request, "POST", "/api/feature_toggles/global", { token, data });
  const body = await readJsonSafe(response);
  expect(response.status(), "POST /api/feature_toggles/global should return 201").toBe(201);
  return expectId(body?.id, "Feature toggle creation response should include id");
}
async function deleteFeatureToggleIfExists(request, token, toggleId) {
  if (!token || !toggleId) return;
  await apiRequest(
    request,
    "DELETE",
    `/api/feature_toggles/global?id=${encodeURIComponent(toggleId)}`,
    { token }
  ).catch(() => void 0);
}
export {
  createFeatureToggleFixture,
  deleteFeatureToggleIfExists
};
//# sourceMappingURL=featureTogglesFixtures.js.map
