27 lines
838 B
TypeScript
27 lines
838 B
TypeScript
/**
|
|
* Tab bar icons (components/icons/*).
|
|
*/
|
|
|
|
import React from 'react'
|
|
import { render } from '@testing-library/react-native'
|
|
|
|
import CartIcon from '@/components/icons/CartIcon'
|
|
import HomeIcon from '@/components/icons/HomeIcon'
|
|
import MeIcon from '@/components/icons/MeIcon'
|
|
import OffersIcon from '@/components/icons/OffersIcon'
|
|
import StoresIcon from '@/components/icons/StoresIcon'
|
|
|
|
const icons = [
|
|
['HomeIcon', HomeIcon],
|
|
['CartIcon', CartIcon],
|
|
['StoresIcon', StoresIcon],
|
|
['OffersIcon', OffersIcon],
|
|
['MeIcon', MeIcon],
|
|
] as const
|
|
|
|
describe('tab icons', () => {
|
|
it.each(icons)('%s renders focused and unfocused', (_name, Icon) => {
|
|
expect(render(<Icon focused size={24} color="#000" />).toJSON()).not.toBeNull()
|
|
expect(render(<Icon focused={false} size={24} color="#000" />).toJSON()).not.toBeNull()
|
|
})
|
|
})
|