Add a test to appease the CI
continuous-integration/drone/push Build is passing Details

More tests will follow at the end if there is time
pull/3/head
Alexis Drai 2 years ago
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();
});
});

@ -2187,7 +2187,7 @@
"@testing-library/react-native@^12.1.2":
version "12.1.2"
resolved "https://registry.npmjs.org/@testing-library/react-native/-/react-native-12.1.2.tgz"
resolved "https://registry.yarnpkg.com/@testing-library/react-native/-/react-native-12.1.2.tgz#1935affe1106aeddf0087dff31a6d7414917c098"
integrity sha512-5rQMQpbSQAuJc4TxjTt1IoeT1a5eVXaa61hf/YcjV2QtGqCoyhuW8DvhTowrL7y2Ds4NzuYBmbVxjNPR6GIblw==
dependencies:
pretty-format "^29.0.0"

Loading…
Cancel
Save