diff --git a/components/__tests__/AreaRugTag-test.tsx b/components/__tests__/AreaRugTag-test.tsx new file mode 100644 index 0000000..3a1beb5 --- /dev/null +++ b/components/__tests__/AreaRugTag-test.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { render, screen } from '@testing-library/react-native'; +import { AreaRugTag } from '@/components/AreaRugTag'; +import { area_t } from '@/lib/dimensions'; +import dayjs from 'dayjs'; +import { Area } from 'convert'; + +describe('AreaRugTag', () => { + it('renders correctly with dimensions, price per area, date and currency symbol', () => { + const dimensions: area_t = { l: 10, w: 20, u: 'foot' }; + const pricePerArea = { price: 100, per: { n: 1, u: 'square foot' as Area } }; + const date = dayjs(); + const currencySymbol = '$'; + + render( + + ); + + expect(screen.getByText(`${dimensions.l} x ${dimensions.w}`)).toBeTruthy(); + // expect(screen.getByLabelText('area rug price')).toContain(currencySymbol); + expect(screen.getByText(date.format('YYYY/MM/DD'))).toBeTruthy(); + expect(screen.getByLabelText('this week\'s color')).toBeTruthy(); + }); +});