PR-722301: Adding Button Test.
This commit is contained in:
parent
b100dc40c3
commit
77935d20b9
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();
|
||||||
|
})
|
||||||
|
})
|
@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Item, Status } from '@components';
|
import { Item, Status } from '@components';
|
||||||
|
|
||||||
describe('Testing Card Component', () => {
|
describe('Testing Item Component', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.mount(<Item name='Item Test' status={Status.DONE} />);
|
cy.mount(<Item name='Item Test' status={Status.DONE} />);
|
||||||
})
|
})
|
||||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import { Item, Status } from '@components';
|
import { Item, Status } from '@components';
|
||||||
|
|
||||||
describe('<App/> Component', () => {
|
describe('Testing Item Component', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// fetchMock.resetMocks();
|
// fetchMock.resetMocks();
|
||||||
render(<Item name='Item Test' status={Status.DONE} handleChange={ () => {}} />)
|
render(<Item name='Item Test' status={Status.DONE} handleChange={ () => {}} />)
|
||||||
|
Loading…
Reference in New Issue
Block a user