unit test case
This commit is contained in:
hiteshkumar87 2025-04-23 13:00:05 +05:30
parent 81fd0eec8d
commit 8452917fc4
2 changed files with 9 additions and 8 deletions

View file

@ -117,6 +117,12 @@ function setupMocks() {
return "false";
}),
hasSettingEqualTo: jest.fn((settingName) => {
if (settingName === experimentSettings.DISPLAY_AFTERPAY_BREAKOUT_DISPLAY) {
return true;
}
return false;
}),
getCmsContent: jest.fn().mockImplementation(() => {
return "test text";
}),

View file

@ -136,7 +136,6 @@ import {
} from "@/helpers/cms-content-helper";
import { paymentMethods } from "@/constants/payment-method-constants";
import { experimentSettings } from "@/constants/experiments";
import experimentMixin from "@/mixins/experiment-mixin.js";
import {
revalidatePromosAndValidateQueryStringPromo,
buildToastMessagesFromRevalidateOrValidatePromoResponse,
@ -812,18 +811,14 @@ export default {
},
isRecalPriceRemove() {
return (
experimentMixin.methods
.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)
?.toLowerCase() === "true"
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() ===
"true"
);
},
isAfterpayBreakoutDisplay() {
return (
(!this.isRecalPriceRemove || !this.isRecalibrationOnOrder) &&
experimentMixin.methods.hasSettingEqualTo(
experimentSettings.DISPLAY_AFTERPAY_BREAKOUT_DISPLAY,
"true"
)
this.hasSettingEqualTo(experimentSettings.DISPLAY_AFTERPAY_BREAKOUT_DISPLAY, "true")
);
},
},