{"size": 1100, "ext": "js", "max_stars_repo_path": "src/__tests__/views/PaymentsPage/PaymentsForm.test.js", "max_stars_repo_name": "sineverba/online-banking-frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/__tests__/views/PaymentsPage/PaymentsForm.test.js", "max_issues_repo_name": "sineverba/online-banking-frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/__tests__/views/PaymentsPage/PaymentsForm.test.js", "max_forks_repo_name": "sineverba/online-banking-frontend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.2051282051, "max_line_length": 68, "alphanum_fraction": 0.59}
import { fireEvent, render, screen } from "@testing-library/react";
import thunk from "redux-thunk";
import configureMockStore from "redux-mock-store";
import PaymentsForm from "../../../views/PaymentsPage/PaymentsForm";

const middlewares = [thunk];
const mockStore = configureMockStore(middlewares);

const initialState = {};

const store = mockStore(initialState);

describe('Test Login Form', () => {
    it ('Should handle click', () => {
        render(<PaymentsForm store={store} />);
        fireEvent.change(screen.getByLabelText(/amount/i), {
            target: {
                value: "1234.56"
            }
        })

        fireEvent.change(screen.getByLabelText(/purpose/i), {
            target: {
                value: "High School 2021 - 2022"
            }
        })

        const button = screen.getByRole('button')
        fireEvent.click(button);
    });

    it ('Should not handle click if fields are empty', () => {

        render(<PaymentsForm store={store} />);
        const button = screen.getByRole('button')
        fireEvent.click(button);
        
    });
});