IO-2327 payments test cases
This commit is contained in:
@@ -100,6 +100,7 @@ export function JobPayments({
|
||||
<Space wrap>
|
||||
<Button
|
||||
// disabled={record.exportedat}
|
||||
data-cy="edit-payment-button"
|
||||
onClick={() => {
|
||||
setPaymentContext({
|
||||
actions: { refetch: refetch },
|
||||
@@ -150,6 +151,7 @@ export function JobPayments({
|
||||
extra={
|
||||
<Space wrap>
|
||||
<Button
|
||||
data-cy="job-payment-button"
|
||||
disabled={!job.converted}
|
||||
onClick={() =>
|
||||
setPaymentContext({
|
||||
@@ -170,6 +172,7 @@ export function JobPayments({
|
||||
}
|
||||
>
|
||||
<Table
|
||||
data-cy="payments-table"
|
||||
columns={columns}
|
||||
rowKey="id"
|
||||
pagination={false}
|
||||
|
||||
@@ -15,11 +15,7 @@ const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
|
||||
export function PaymentFormComponent({
|
||||
form,
|
||||
bodyshop,
|
||||
disabled,
|
||||
}) {
|
||||
export function PaymentFormComponent({ form, bodyshop, disabled }) {
|
||||
const { Qb_Multi_Ar } = useTreatments(
|
||||
["Qb_Multi_Ar"],
|
||||
{},
|
||||
@@ -65,16 +61,16 @@ export function PaymentFormComponent({
|
||||
},
|
||||
]}
|
||||
>
|
||||
<CurrencyInput disabled={disabled} />
|
||||
<CurrencyInput data-cy="payment-amount" disabled={disabled} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("payments.fields.transactionid")}
|
||||
name="transactionid"
|
||||
>
|
||||
<Input disabled={disabled} />
|
||||
<Input data-cy="payment-transactionid" disabled={disabled} />
|
||||
</Form.Item>
|
||||
<Form.Item label={t("payments.fields.memo")} name="memo">
|
||||
<Input disabled={disabled} />
|
||||
<Input data-cy="payment-memo" disabled={disabled} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("payments.fields.date")}
|
||||
@@ -86,7 +82,7 @@ export function PaymentFormComponent({
|
||||
},
|
||||
]}
|
||||
>
|
||||
<DatePickerFormItem disabled={disabled} />
|
||||
<DatePickerFormItem data-cy="payment-date" disabled={disabled} />
|
||||
</Form.Item>
|
||||
</LayoutFormRow>
|
||||
|
||||
@@ -101,7 +97,11 @@ export function PaymentFormComponent({
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select disabled={disabled}>
|
||||
<Select
|
||||
data-cy="payment-customer"
|
||||
className="ant-select-payer"
|
||||
disabled={disabled}
|
||||
>
|
||||
<Select.Option value={t("payments.labels.customer")}>
|
||||
{t("payments.labels.customer")}
|
||||
</Select.Option>
|
||||
@@ -133,7 +133,11 @@ export function PaymentFormComponent({
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Select disabled={disabled}>
|
||||
<Select
|
||||
data-cy="payment-type"
|
||||
className="ant-select-type"
|
||||
disabled={disabled}
|
||||
>
|
||||
{bodyshop.md_payment_types.map((v, idx) => (
|
||||
<Select.Option key={idx} value={v}>
|
||||
{v}
|
||||
|
||||
@@ -88,6 +88,7 @@ const PaymentMarkForExportButton = ({
|
||||
onClick={handleClick}
|
||||
loading={exportLogLoading || updatePaymentLoading}
|
||||
disabled={!!payment.exportedat}
|
||||
data-cy="payment-markexported"
|
||||
>
|
||||
{t("payments.labels.markexported")}
|
||||
</Button>
|
||||
|
||||
@@ -161,7 +161,11 @@ function PaymentModalContainer({
|
||||
footer={
|
||||
<span>
|
||||
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button>
|
||||
<Button loading={loading} onClick={() => form.submit()}>
|
||||
<Button
|
||||
data-cy="payment-form-save"
|
||||
loading={loading}
|
||||
onClick={() => form.submit()}
|
||||
>
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
{paymentModal.context && paymentModal.context.id ? null : (
|
||||
|
||||
@@ -57,6 +57,7 @@ const PaymentReexportButton = ({ payment, refetch, setPaymentContext }) => {
|
||||
onClick={handleClick}
|
||||
loading={loading}
|
||||
disabled={!payment.exportedat}
|
||||
data-cy="payment-markforreexport"
|
||||
>
|
||||
{t("payments.labels.markforreexport")}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user