diff --git a/.gitignore b/.gitignore index 9cd9b97e..f3993513 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ web-build/ # macOS .DS_Store -.env \ No newline at end of file +.env +coverage/ \ No newline at end of file diff --git a/__tests__/components/Button.js b/__tests__/components/Button.js new file mode 100644 index 00000000..063ebf06 --- /dev/null +++ b/__tests__/components/Button.js @@ -0,0 +1,96 @@ +import React from 'react' +import { + toBeDisabled, + toHaveStyle, + toHaveTextContent +} from '@testing-library/jest-native' +import { cleanup, fireEvent, render } from '@testing-library/react-native/pure' + +import Button from '@components/Button' + +expect.extend({ toBeDisabled, toHaveStyle, toHaveTextContent }) + +describe('Testing component button', () => { + afterEach(cleanup) + + describe('static button', () => { + it('with text only', () => { + const onPress = jest.fn() + const { getByTestId, toJSON } = render( +