mirror of
https://github.com/aleleba/react-list-ui-library.git
synced 2025-09-18 12:46:33 -06:00
PR-722301: Adding Button Test.
This commit is contained in:
11
src/components/Button/__tests__/Button.test.cy.tsx
Normal file
11
src/components/Button/__tests__/Button.test.cy.tsx
Normal file
@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
import { Button } from '@components';
|
||||
|
||||
describe('Testing Button Component', () => {
|
||||
beforeEach(() => {
|
||||
cy.mount(<Button />);
|
||||
});
|
||||
it('Show Button', () => {
|
||||
cy.get('button').should('have.length', 1);
|
||||
});
|
||||
})
|
17
src/components/Button/__tests__/Button.test.tsx
Normal file
17
src/components/Button/__tests__/Button.test.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { Button } from '@components';
|
||||
|
||||
describe('Testing Button Component', () => {
|
||||
beforeEach(() => {
|
||||
// fetchMock.resetMocks();
|
||||
render(<Button />)
|
||||
});
|
||||
it('Show Button', async () => {
|
||||
/* fetchMock.mockResponseOnce(JSON.stringify({
|
||||
//First Data Fetch
|
||||
data: 'data'
|
||||
})); */
|
||||
expect(screen.getByRole('button')).toBeInTheDocument();
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user