mirror of
https://github.com/aleleba/create-react-component-library.git
synced 2025-06-19 20:38:17 -06:00
PR-188649:
Adding Test to proyect.
This commit is contained in:
1
src/__mocks__/fileMock.ts
Normal file
1
src/__mocks__/fileMock.ts
Normal file
@ -0,0 +1 @@
|
||||
module.exports = '';
|
20
src/components/__tests__/Card.test.tsx
Normal file
20
src/components/__tests__/Card.test.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import { Card } from '../Card';
|
||||
|
||||
describe('<App/> Component', () => {
|
||||
beforeEach(() => {
|
||||
fetchMock.resetMocks();
|
||||
});
|
||||
|
||||
test('Should render <Card /> Component', async () => {
|
||||
fetchMock.mockResponseOnce(JSON.stringify({
|
||||
//First Data Fetch
|
||||
data: 'data'
|
||||
}));
|
||||
|
||||
render(
|
||||
<Card title='Test Title'><p>Test Content</p></Card>
|
||||
)
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user