mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 21:45:25 +02:00
feat: Default To Fractions When Unit Is Empty (#3587)
Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
parent
554b3fa749
commit
c82549ccb4
4 changed files with 22 additions and 7 deletions
|
@ -34,6 +34,12 @@ describe(parseIngredientText.name, () => {
|
|||
expect(parseIngredientText(ingredient, false, 1, true)).contain("1 <sup>1</sup>").and.to.contain("<sub>2</sub>");
|
||||
});
|
||||
|
||||
test("ingredient text with fraction when unit is null", () => {
|
||||
const ingredient = createRecipeIngredient({ quantity: 1.5, unit: undefined });
|
||||
|
||||
expect(parseIngredientText(ingredient, false, 1, true)).contain("1 <sup>1</sup>").and.to.contain("<sub>2</sub>");
|
||||
});
|
||||
|
||||
test("ingredient text with fraction no formatting", () => {
|
||||
const ingredient = createRecipeIngredient({ quantity: 1.5, unit: { fraction: true, id: "1", name: "cup" } });
|
||||
const result = parseIngredientText(ingredient, false, 1, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue