From 5573bb3568d0e42a1d9941c39721520cf5c72bfb Mon Sep 17 00:00:00 2001 From: devops Date: Sat, 17 Oct 2026 11:24:36 +0000 Subject: [PATCH] fix(wiki): contain long ingredient codes on mobile --- .../application/components/IngredientWiki.tsx | 2 +- .../components/__tests__/IngredientWiki.test.tsx | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/frontend/application/components/IngredientWiki.tsx b/frontend/application/components/IngredientWiki.tsx index ec4d50d3..64b6427d 100644 --- a/frontend/application/components/IngredientWiki.tsx +++ b/frontend/application/components/IngredientWiki.tsx @@ -261,7 +261,7 @@ export default function IngredientWiki() {

{ing.name}

- کد ماده مؤثره: {ing.id} + کد ماده مؤثره: {ing.id}
diff --git a/frontend/application/components/__tests__/IngredientWiki.test.tsx b/frontend/application/components/__tests__/IngredientWiki.test.tsx index 3f75c227..68322ba3 100644 --- a/frontend/application/components/__tests__/IngredientWiki.test.tsx +++ b/frontend/application/components/__tests__/IngredientWiki.test.tsx @@ -290,4 +290,20 @@ describe('IngredientWiki Component', () => { expect(container.firstElementChild).not.toHaveClass('py-12'); }); + + it('wraps long ingredient codes inside the mobile card', async () => { + (productService.getProducts as any).mockResolvedValueOnce({ data: [] }); + (api.get as any).mockResolvedValueOnce({ data: [{ + id: 'beef-broth-279-spray-dried', + slug: 'beef-broth-279-spray-dried', + nameFa: 'آب گوشت گاو', + description: 'توضیح', + benefits: [], + }] }); + + render(); + await waitFor(() => expect(screen.getByText('آب گوشت گاو')).toBeInTheDocument()); + expect(screen.getByTestId('wiki-ingredient-code')).toHaveClass('max-w-full', 'break-all'); + }); + });