PR-722301: Adding Input and List Components testing.

This commit is contained in:
2023-10-12 00:08:05 +00:00
parent 966ef13300
commit d1da40fdd2
7 changed files with 96 additions and 3 deletions

View File

@ -0,0 +1,11 @@
import React from 'react';
import { Input } from '@components';
describe('Testing Input Component', () => {
beforeEach(() => {
cy.mount(<Input placeholder='Test Placeholder' />);
});
it('Show right text on placeholder', () => {
cy.get('input').should('have.attr', 'placeholder', 'Test Placeholder');
});
})

View File

@ -0,0 +1,18 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { Input } from '@components';
describe('Testing Input Component', () => {
beforeEach(() => {
// fetchMock.resetMocks();
render(<Input placeholder='Test Placeholder'/>)
});
it('Show right text on placeholder', async () => {
/* fetchMock.mockResponseOnce(JSON.stringify({
//First Data Fetch
data: 'data'
})); */
const input = screen.getByPlaceholderText('Test Placeholder');
expect(input).toBeInTheDocument();
})
})