✅ Add a test to appease the CI
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
More tests will follow at the end if there is timepull/3/head
parent
411a1c96d6
commit
4780ef2c54
@ -0,0 +1,25 @@
|
||||
import React from 'react';
|
||||
import {render} from '@testing-library/react-native';
|
||||
import TypeTacticsInfoList from './TypeTacticsInfoList';
|
||||
|
||||
describe('TypeTacticsInfoList component', () => {
|
||||
it('renders types correctly', () => {
|
||||
const types = ['FIRE', 'WATER', 'GRASS'];
|
||||
const {getByText} = render(<TypeTacticsInfoList isWeakness={true} types={types}/>);
|
||||
|
||||
types.forEach(type => {
|
||||
expect(getByText(type)).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
it('renders "Nothing" when types array is empty', () => {
|
||||
const {getByText} = render(<TypeTacticsInfoList isWeakness={false} types={[]}/>);
|
||||
expect(getByText('Nothing')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('renders "Nothing" when types is undefined', () => {
|
||||
// @ts-ignore
|
||||
const {getByText} = render(<TypeTacticsInfoList isWeakness={true} types={undefined}/>);
|
||||
expect(getByText('Nothing')).toBeTruthy();
|
||||
});
|
||||
});
|
Loading…
Reference in new issue