Jump to content

Template:Recipe/testcases: Difference between revisions

From Recipedius
0.010 T016: deploy 0.009 recipe and ingredient contract, 0.007 techniques, and template sandboxes (dbbad33)
 
0.015 T013: target missing ingredients and canonicalize fractions (1b80afc)
 
(One intermediate revision by the same user not shown)
Line 13: Line 13:
|ingredients=
|ingredients=
Butter; 1; cup; creaming; softened
Butter; 1; cup; creaming; softened
Granulated sugar; 1/2; cup; sweet
Granulated sugar; ½; cup; sweet
All-purpose flour; 2; cup; structure
All-purpose flour; 2; cup; structure
|instructions=
|instructions=
Line 21: Line 21:


Must render Description, Ingredients and Instructions in that order, with the
Must render Description, Ingredients and Instructions in that order, with the
substitution section after Instructions.
substitution section after Instructions. The legacy Unicode fraction input must
render as the ASCII quantity `1/2 cup`.


== Legacy parameter names ==
== Legacy parameter names ==
Line 69: Line 70:
that contributes calories and allergens. The second names an existing recipe
that contributes calories and allergens. The second names an existing recipe
and must also be a plain internal link, with no missing marker. The third names
and must also be a plain internal link, with no missing marker. The third names
a page that does not exist: it must be a red link, carry the missing marker,
a page that does not exist: it must link to
and appear in the missing-nutrition warning above.
`Special:FormEdit/Ingredient/Nonexistent ingredient page`, carry the missing
marker, and appear in the missing-nutrition warning above. That route must
open the pre-targeted Ingredient form rather than the generic raw editor.


== No description and no instructions ==
== No description and no instructions ==

Latest revision as of 14:04, 25 September 2026

Cases for Template:Recipe/sandbox. Each one states what it is meant to show. Check them after any change to the recipe template or to Module:Recipedius, and before that change is committed for deployment.

Preferred parameter names

Template:Recipe/testcases
Serves 24
Time 50 min
Per serving 122 kcal (2925 for the batch)
Contains dairy, wheat, gluten
Contributed by Testcases
Tags dessert · baking
Calories are computed from the ingredient records. Approximate.

Description

Written with the preferred description and instructions names.

Ingredients

Quantity Ingredient Its job here Swaps
1 cup Butter, softened creaming 5 options
1/2 cup Granulated sugar sweet 2 options
2 cups All-purpose flour structure 1 option

Instructions

  1. Beat the butter and sugar until pale.
  2. Stir in the flour.

Substitutions for this recipe

Rules come from each ingredient's record and are resolved for the job the ingredient does in this recipe. Confidence is the community's, not a guarantee.

Instead of Use How much What changes Confidence
Butter Coconut oil 1 cup (× 1) Chill until firm, then cream. Cookies spread a little more and set crisper.
⚠ Labeled as a tree nut by the FDA; check with anyone who avoids tree nuts. rule for: creaming
●●○ medium
Butter Greek yogurt replace half the butter with the same volume of yogurt Replaces half the butter with an equal volume of Greek yogurt. Denser, tangier, fewer calories.
⚠ Quick breads only. Do not use in cookies, shortbread, crusts, or pans.
●○○ low
Butter Margarine 1 cup (× 1) Nearly identical result. Cookies spread slightly more and taste a little flatter. ●●● high
Butter Olive oil 3/4 cup (× 0.75) Skip the creaming step and whisk oil with sugar. Expect a flat, dense result.
⚠ In shortbread or pound cake this is a different dessert. rule for: creaming
●○○ low
Butter Vegetable shortening 1 cup (× 1) Taller, softer cookies and flakier crusts, but no butter flavor. Add ⅛ tsp salt per ½ cup.
⚠ Flavor loss is obvious in shortbread and pound cake.
●●● high
Granulated sugar Honey 3/8 cup (× 0.75) Use ¾ the volume. Reduce other liquid by 3 tbsp per cup of honey, add ¼ tsp baking soda per cup, and lower the oven 25°F: honey browns fast.
⚠ Never for infants under one year.
●●○ medium
Granulated sugar Maple syrup 3/8 cup (× 0.75) Use ¾ the volume and reduce other liquid by 3 tbsp per cup of syrup. Milder browning than honey; flavor shows in quick breads. ●●○ medium
All-purpose flour Gluten-free flour blend 2 cups (× 1) One-for-one with a blend that includes xanthan gum. Rest the batter 30 minutes. Crumb is more delicate; cookies are a bit sandier.
⚠ For yeast breads a blend is not enough; that needs a different recipe.
●●○ medium

Must render Description, Ingredients and Instructions in that order, with the substitution section after Instructions. The legacy Unicode fraction input must render as the ASCII quantity `1/2 cup`.

Legacy parameter names

Template:Recipe/testcases
Serves 24
Time 50 min
Per serving 68 kcal (1628 for the batch)
Contains dairy
Contributed by Testcases
Calories are computed from the ingredient records. Approximate.

Description

Written with the legacy lede and method names.

Ingredients

Quantity Ingredient Its job here Swaps
1 cup Butter creaming 5 options

Instructions

  1. Melt the butter.

Substitutions for this recipe

Rules come from each ingredient's record and are resolved for the job the ingredient does in this recipe. Confidence is the community's, not a guarantee.

Instead of Use How much What changes Confidence
Butter Coconut oil 1 cup (× 1) Chill until firm, then cream. Cookies spread a little more and set crisper.
⚠ Labeled as a tree nut by the FDA; check with anyone who avoids tree nuts. rule for: creaming
●●○ medium
Butter Greek yogurt replace half the butter with the same volume of yogurt Replaces half the butter with an equal volume of Greek yogurt. Denser, tangier, fewer calories.
⚠ Quick breads only. Do not use in cookies, shortbread, crusts, or pans.
●○○ low
Butter Margarine 1 cup (× 1) Nearly identical result. Cookies spread slightly more and taste a little flatter. ●●● high
Butter Olive oil 3/4 cup (× 0.75) Skip the creaming step and whisk oil with sugar. Expect a flat, dense result.
⚠ In shortbread or pound cake this is a different dessert. rule for: creaming
●○○ low
Butter Vegetable shortening 1 cup (× 1) Taller, softer cookies and flakier crusts, but no butter flavor. Add ⅛ tsp salt per ½ cup.
⚠ Flavor loss is obvious in shortbread and pound cake.
●●● high

Must render identically in structure to the case above. Existing pages and the Page Forms still use these names.

Preferred name wins over legacy

Template:Recipe/testcases
Serves 1
Per serving 102 kcal (102 for the batch)
Contains dairy
Calories are computed from the ingredient records. Approximate.

Description

This preferred description must be the one shown.

Ingredients

Quantity Ingredient Its job here Swaps
1 tbsp Butter melted 5 options

Instructions

  1. These preferred instructions must be the ones shown.

Substitutions for this recipe

Rules come from each ingredient's record and are resolved for the job the ingredient does in this recipe. Confidence is the community's, not a guarantee.

Instead of Use How much What changes Confidence
Butter Coconut oil 1 tbsp (× 1) One-for-one. Chill it first if the recipe creams; use refined to avoid coconut flavor.
⚠ Labeled as a tree nut by the FDA; check with anyone who avoids tree nuts.
●●○ medium
Butter Greek yogurt replace half the butter with the same volume of yogurt Swap half the melted butter for yogurt; the loaf stays moist and tightens slightly.
⚠ Quick breads only. Do not use in cookies, shortbread, crusts, or pans. rule for: melted
●●○ medium
Butter Margarine 1 tbsp (× 1) Nearly identical result. Cookies spread slightly more and taste a little flatter. ●●● high
Butter Olive oil 3/4 tbsp (× 0.75) Use ¾ the amount; mix with the wet ingredients. Moister, keeps longer.
⚠ Oil cannot be creamed. Where the recipe creams butter and sugar, the texture changes a lot. rule for: melted
●●● high
Butter Vegetable shortening 1 tbsp (× 1) Taller, softer cookies and flakier crusts, but no butter flavor. Add ⅛ tsp salt per ½ cup.
⚠ Flavor loss is obvious in shortbread and pound cake.
●●● high

Ingredient link resolution

Template:Recipe/testcases
Serves 2
Per serving 814 kcal (1628 for the batch)
Contains dairy
Calories are computed from the ingredient records. Approximate.

Description

Three kinds of ingredient line.
These ingredients have no record yet, so they are left out of the nutrition and substitution tables: Nonexistent ingredient page. Follow a name to create its record.

Ingredients

Quantity Ingredient Its job here Swaps
1 cup Butter creaming 5 options
1 Classic shortbread inclusion none
1 cup Nonexistent ingredient page? structure none

Instructions

  1. Nothing to do.

Substitutions for this recipe

Rules come from each ingredient's record and are resolved for the job the ingredient does in this recipe. Confidence is the community's, not a guarantee.

Instead of Use How much What changes Confidence
Butter Coconut oil 1 cup (× 1) Chill until firm, then cream. Cookies spread a little more and set crisper.
⚠ Labeled as a tree nut by the FDA; check with anyone who avoids tree nuts. rule for: creaming
●●○ medium
Butter Greek yogurt replace half the butter with the same volume of yogurt Replaces half the butter with an equal volume of Greek yogurt. Denser, tangier, fewer calories.
⚠ Quick breads only. Do not use in cookies, shortbread, crusts, or pans.
●○○ low
Butter Margarine 1 cup (× 1) Nearly identical result. Cookies spread slightly more and taste a little flatter. ●●● high
Butter Olive oil 3/4 cup (× 0.75) Skip the creaming step and whisk oil with sugar. Expect a flat, dense result.
⚠ In shortbread or pound cake this is a different dessert. rule for: creaming
●○○ low
Butter Vegetable shortening 1 cup (× 1) Taller, softer cookies and flakier crusts, but no butter flavor. Add ⅛ tsp salt per ½ cup.
⚠ Flavor loss is obvious in shortbread and pound cake.
●●● high

The first line names an ingredient record and must be a plain internal link that contributes calories and allergens. The second names an existing recipe and must also be a plain internal link, with no missing marker. The third names a page that does not exist: it must link to `Special:FormEdit/Ingredient/Nonexistent ingredient page`, carry the missing marker, and appear in the missing-nutrition warning above. That route must open the pre-targeted Ingredient form rather than the generic raw editor.

No description and no instructions

Template:Recipe/testcases
Serves 1
Per serving 102 kcal (102 for the batch)
Contains dairy
Calories are computed from the ingredient records. Approximate.

Description

No description yet.

Ingredients

Quantity Ingredient Its job here Swaps
1 tbsp Butter 5 options

Instructions

No instructions yet.

Substitutions for this recipe

Rules come from each ingredient's record and are resolved for the job the ingredient does in this recipe. Confidence is the community's, not a guarantee.

Instead of Use How much What changes Confidence
Butter Coconut oil 1 tbsp (× 1) One-for-one. Chill it first if the recipe creams; use refined to avoid coconut flavor.
⚠ Labeled as a tree nut by the FDA; check with anyone who avoids tree nuts.
●●○ medium
Butter Greek yogurt replace half the butter with the same volume of yogurt Replaces half the butter with an equal volume of Greek yogurt. Denser, tangier, fewer calories.
⚠ Quick breads only. Do not use in cookies, shortbread, crusts, or pans.
●○○ low
Butter Margarine 1 tbsp (× 1) Nearly identical result. Cookies spread slightly more and taste a little flatter. ●●● high
Butter Olive oil 3/4 tbsp (× 0.75) Use ¾ the amount. Denser, moister crumb.
⚠ Oil cannot be creamed. Where the recipe creams butter and sugar, the texture changes a lot.
●●○ medium
Butter Vegetable shortening 1 tbsp (× 1) Taller, softer cookies and flakier crusts, but no butter flavor. Add ⅛ tsp salt per ½ cup.
⚠ Flavor loss is obvious in shortbread and pound cake.
●●● high

Both headings must still appear, each with its placeholder text, so the page shape is predictable while a recipe is being written.

Empty call

Template:Recipe/testcases
Serves 1
Per serving 0 kcal (0 for the batch)
Contains nothing flagged
Calories are computed from the ingredient records. Approximate.

Description

No description yet.

Ingredients

Quantity Ingredient Its job here Swaps

Instructions

No instructions yet.

Must not raise a script error.