first commit
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveRecipeBaseId } from "./recipe-category.mjs";
|
||||
|
||||
describe("resolveRecipeBaseId", () => {
|
||||
it("met en avant le tag carnet avant toute règle sur le slug", () => {
|
||||
expect(resolveRecipeBaseId("onigiri-saumon", ["carnet"])).toBe("base:carnet");
|
||||
});
|
||||
|
||||
it("classe les bouchées de riz", () => {
|
||||
expect(resolveRecipeBaseId("onigiri-thon", [])).toBe("base:onigiri");
|
||||
expect(resolveRecipeBaseId("inarizushi", [])).toBe("base:onigiri");
|
||||
expect(resolveRecipeBaseId("spam-musubi", [])).toBe("base:onigiri");
|
||||
});
|
||||
|
||||
it("classe les rouleaux de riz", () => {
|
||||
expect(resolveRecipeBaseId("gimbap-legumes", [])).toBe("base:gimbap");
|
||||
expect(resolveRecipeBaseId("kimbap", [])).toBe("base:gimbap");
|
||||
expect(resolveRecipeBaseId("maki-saumon", [])).toBe("base:gimbap");
|
||||
});
|
||||
|
||||
it("ne confond pas makisu avec maki", () => {
|
||||
expect(resolveRecipeBaseId("makisu-bambou", [])).not.toBe("base:gimbap");
|
||||
expect(resolveRecipeBaseId("makisu-bambou", [])).toBe("base:carnet");
|
||||
});
|
||||
|
||||
it("classe mandu / gyoza", () => {
|
||||
expect(resolveRecipeBaseId("mandu-kimchi", [])).toBe("base:mandu");
|
||||
expect(resolveRecipeBaseId("gyoza-porc", [])).toBe("base:mandu");
|
||||
});
|
||||
|
||||
it("sépare empanadas sucrées et salées", () => {
|
||||
expect(resolveRecipeBaseId("empanadas-citron", [])).toBe("base:empanadas-sweet");
|
||||
expect(resolveRecipeBaseId("empanadas-viande", [])).toBe("base:empanadas-savory");
|
||||
});
|
||||
|
||||
it("classe galettes et bao", () => {
|
||||
expect(resolveRecipeBaseId("dan-bing", [])).toBe("base:galettes");
|
||||
expect(resolveRecipeBaseId("blinis", [])).toBe("base:galettes");
|
||||
expect(resolveRecipeBaseId("naan-fromage", [])).toBe("base:galettes");
|
||||
expect(resolveRecipeBaseId("bao-porc", [])).toBe("base:bao");
|
||||
expect(resolveRecipeBaseId("mantou-fourre", [])).toBe("base:bao");
|
||||
});
|
||||
|
||||
it("classe muffins, mini-cakes, biscuits, fluffy cakes et cakes", () => {
|
||||
expect(resolveRecipeBaseId("muffin-myrtille", [])).toBe("base:muffin");
|
||||
expect(resolveRecipeBaseId("madeleine-citron", [])).toBe("base:mini-cakes");
|
||||
expect(resolveRecipeBaseId("biscuit-speculoos", [])).toBe("base:biscuits-secs");
|
||||
expect(resolveRecipeBaseId("gateau-savoie", [])).toBe("base:fluffy-cakes");
|
||||
expect(resolveRecipeBaseId("carrot-cake", [])).toBe("base:cakes");
|
||||
expect(resolveRecipeBaseId("cheesecake-japonais", [])).toBe("base:cakes");
|
||||
});
|
||||
|
||||
it("utilise le carnet comme défaut quand rien ne matche", () => {
|
||||
expect(resolveRecipeBaseId("recette-inconnue", [])).toBe("base:carnet");
|
||||
expect(resolveRecipeBaseId("guacamole", ["apéritif", "guacamole", "avocat", "carnet"])).toBe("base:carnet");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user