diff --git a/src/components/modal/index.tsx b/src/components/modal/index.tsx index 9012a8f2..f49c071b 100644 --- a/src/components/modal/index.tsx +++ b/src/components/modal/index.tsx @@ -58,6 +58,7 @@ export default function MyModal({ transparent animationType={animation} onRequestClose={close} + testID='testCoinSelectionModal' > { fireEvent.press(screen.getByTestId('addPersonal')) expect(screen.queryByPlaceholderText('Name')).toBeNull() }) + it('Addressbook modal has a specific style applied', () => { + render( + l('test')} + setInput={() => l('test')} + /> + ) + const modal = screen.getByTestId('testCoinSelectionModal') + expect(modal.props.children.props.children.props.style[0].paddingHorizontal).toBe(0) + }) // TODO test the functionality of adding a new contact and rendering it // eslint-disable-next-line jest/no-commented-out-tests // it('Render the new contact', async () => { diff --git a/test/components/CoinSelectionModal.test.tsx b/test/components/CoinSelectionModal.test.tsx new file mode 100644 index 00000000..e8830cb6 --- /dev/null +++ b/test/components/CoinSelectionModal.test.tsx @@ -0,0 +1,20 @@ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ +import { CoinSelectionModal } from '@screens/Lightning/modal' +import { l } from '@src/logger' +import { render, screen } from '@testing-library/react-native' + +describe('Basic styling test of the CoinSelectionModal component', () => { + it('has a specific style applied', () => { + render( + l('test coin selection modal')} + proofs={[]} + setProof={() => l('proofs')} + /> + ) + const modal = screen.getByTestId('testCoinSelectionModal') + expect(modal.props.children.props.children.props.style[0].paddingHorizontal).toBe(0) + }) +})