import assert from "node:assert/strict"; import { Then } from "@cucumber/cucumber"; import { slugify } from "../../src/utils/slugify.js"; import type { CustomWorld } from "../support/world.js"; // The feature file still names an item by its French label, for // readability — the response itself carries only the slug `key` (see // reference.service.ts), so this slugifies the expected label before // comparing. Then( "the reference list response should include {string}", function (this: CustomWorld, name: string) { const keys = (this.response.body as Array<{ key: string }>).map((item) => item.key); const expectedKey = slugify(name); assert.ok(keys.includes(expectedKey), `expected ${JSON.stringify(keys)} to include "${expectedKey}"`); }, );