diff --git a/src/components/PickItemRow.test.tsx b/src/components/PickItemRow.test.tsx index 59e2020..3b72490 100644 --- a/src/components/PickItemRow.test.tsx +++ b/src/components/PickItemRow.test.tsx @@ -29,6 +29,34 @@ const baseProduct: Product = { }; describe('PickItemRow', () => { + it('keeps quantity inline with matching typography to the product name', () => { + render( + , + ); + + const productName = screen.getByText(baseProduct.name); + const quantityLabel = screen.getByText('1 unit'); + const titleRow = screen.getByTestId('pick-item-title-row'); + + const rowStyle = getComputedStyle(titleRow); + expect(rowStyle.display).toBe('flex'); + expect(rowStyle.flexDirection).toBe('row'); + + const productStyle = getComputedStyle(productName); + const quantityStyle = getComputedStyle(quantityLabel); + + expect(productStyle.fontSize).toBe(quantityStyle.fontSize); + expect(productStyle.fontWeight).toBe(quantityStyle.fontWeight); + }); + it('asks for confirmation before deleting a product from the pick list', async () => { const onDelete = vi.fn(); const user = userEvent.setup(); diff --git a/src/components/PickItemRow.tsx b/src/components/PickItemRow.tsx index cf409ff..ff22dd7 100644 --- a/src/components/PickItemRow.tsx +++ b/src/components/PickItemRow.tsx @@ -100,27 +100,30 @@ export const PickItemRow = ({ onClick={(event) => event.stopPropagation()} /> - {product?.name ?? 'Unknown product'} {item.quantity} {packagingLabel} - + {isNarrowScreen && ( Tap to adjust quantity and packaging