PR-722301: Adding Button Test.

This commit is contained in:
Alejandro Lembke Barrientos 2023-10-11 23:24:42 +00:00
parent b100dc40c3
commit 77935d20b9
4 changed files with 30 additions and 2 deletions

View 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);
});
})

View 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();
})
})

View File

@ -1,7 +1,7 @@
import React from 'react';
import { Item, Status } from '@components';
describe('Testing Card Component', () => {
describe('Testing Item Component', () => {
beforeEach(() => {
cy.mount(<Item name='Item Test' status={Status.DONE} />);
})

View File

@ -2,7 +2,7 @@ import React from 'react';
import { render, screen } from '@testing-library/react';
import { Item, Status } from '@components';
describe('<App/> Component', () => {
describe('Testing Item Component', () => {
beforeEach(() => {
// fetchMock.resetMocks();
render(<Item name='Item Test' status={Status.DONE} handleChange={ () => {}} />)