Skip to content

Commit

Permalink
fix issues with resolving merge conflicts and fix broken JEST tests
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-fuller committed Nov 11, 2022
1 parent 8d40a2d commit bf54894
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ describe('c-ge-form-renderer', () => {
element.giftInView = {
fields: {
'Recurring_Donation_Recurring_Type__c': 'Fixed',
'Payment_Method__c': 'Credit Card'
'Payment_Method__c': 'Credit Card',
'Recurring_Donation_Elevate_Recurring_ID__c': 'DUMMY_RECURRING_ID'
}
};
await flushPromises();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
horizontal-align='center'
if:false={isPermissionError}>
<lightning-layout-item size='12'
if:true={showPaymentSaveNotice}>
if:true={isWidgetEnabled}>
<p class='slds-align_absolute-center slds-p-top_small'>
{CUSTOM_LABELS.geTextPaymentsSaveNotice}
</p>
Expand Down
10 changes: 7 additions & 3 deletions force-app/main/default/lwc/geFormRenderer/geFormRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ export default class GeFormRenderer extends LightningElement{
});
}

isGiftCommitment() {
return isNotEmpty(this.formState[apiNameFor(DATA_IMPORT_RECURRING_DONATION_ELEVATE_ID)]);
}

loadSelectedDonationFieldValues(record) {
this.loadSelectedRecordFieldValues(
apiNameFor(DATA_IMPORT_DONATION_IMPORTED_FIELD), record.Id);
Expand All @@ -312,7 +316,7 @@ export default class GeFormRenderer extends LightningElement{
_formState = {}

/** Determines when we show payment related text above the cancel and save buttons */
get showPaymentSaveNotice() {
get isWidgetEnabled() {
return this._hasPaymentWidget && this._isElevateWidgetInDisabledState === false;
}

Expand Down Expand Up @@ -1147,7 +1151,7 @@ export default class GeFormRenderer extends LightningElement{

shouldTokenizeCard() {
return Settings.isElevateCustomer()
&& !!(this.showPaymentSaveNotice)
&& !!(this.isWidgetEnabled)
&& this.hasChargeableTransactionStatus();
}

Expand Down Expand Up @@ -2913,7 +2917,7 @@ export default class GeFormRenderer extends LightningElement{
return this.getFieldValueFromFormState(STATUS_FIELD) !== GIFT_STATUSES.IMPORTED &&
(
this.hasUnprocessedReadOnlyPaymentStatus(paymentStatus) ||
this.getFieldValueFromFormState(DATA_IMPORT_RECURRING_DONATION_ELEVATE_ID)
!!this.getFieldValueFromFormState(DATA_IMPORT_RECURRING_DONATION_ELEVATE_ID)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ import DATA_IMPORT_ACCOUNT_NAME from '@salesforce/schema/DataImport__c.Account1_
import DATA_IMPORT_PARENT_BATCH_LOOKUP from '@salesforce/schema/DataImport__c.NPSP_Data_Import_Batch__c';
import DATA_IMPORT_RECURRING_TYPE
from '@salesforce/schema/DataImport__c.Recurring_Donation_Recurring_Type__c';
import DATA_IMPORT_RECURRING_DONATION_ELEVATE_ID
from '@salesforce/schema/DataImport__c.Recurring_Donation_Elevate_Recurring_ID__c';
import DATA_IMPORT_RECURRING_DONATION_ACH_LAST_4
from '@salesforce/schema/DataImport__c.Recurring_Donation_ACH_Last_4__c';
import DATA_IMPORT_RECURRING_DONATION_CARD_LAST_4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import DATA_IMPORT_BATCH_OBJECT from '@salesforce/schema/DataImportBatch__c';
import OPPORTUNITY_OBJECT from '@salesforce/schema/Opportunity';
import FAILURE_INFORMATION from '@salesforce/schema/DataImport__c.FailureInformation__c';
import accountDonorSelectionMismatch from '@salesforce/label/c.geErrorDonorMismatch';
import { fireEvent } from '../../pubsubNoPageRef/pubsubNoPageRef';

const PROCESSING_BATCH_MESSAGE = 'c.geProcessingBatch';

Expand Down Expand Up @@ -257,9 +256,10 @@ describe('c-ge-gift-entry-form-app', () => {
pubSub.fireEvent({}, 'widgetStateChange', {state: 'readOnly'});
await flushPromises();

const saveButton = shadowQuerySelector(geFormRenderer, '[data-id="formSaveButton"]');
const saveButton = shadowQuerySelector(geFormRenderer, '[data-id="bgeSaveButton"]');
expect(saveButton.disabled).toBe(true);
});

it('should disable update button when widget is read-only with an editable status for one-time gift', async() => {
const formApp = setupForBatchMode({gifts: [{fields: {'Id': 'DUMMY_RECORD_ID',
'Payment_Status__c': 'AUTHORIZED'}}], totals: { TOTAL: 1 }});
Expand All @@ -280,7 +280,7 @@ describe('c-ge-gift-entry-form-app', () => {
pubSub.fireEvent({}, 'widgetStateChange', {state: 'readOnly'});
await flushPromises();

const saveButton = shadowQuerySelector(geFormRenderer, '[data-id="formSaveButton"]');
const saveButton = shadowQuerySelector(geFormRenderer, '[data-id="bgeSaveButton"]');
expect(saveButton.disabled).toBe(true);
});

Expand Down

0 comments on commit bf54894

Please sign in to comment.