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"; return "false";
}), }),
hasSettingEqualTo: jest.fn((settingName) => {
if (settingName === experimentSettings.DISPLAY_AFTERPAY_BREAKOUT_DISPLAY) {
return true;
}
return false;
}),
getCmsContent: jest.fn().mockImplementation(() => { getCmsContent: jest.fn().mockImplementation(() => {
return "test text"; return "test text";
}), }),

View file

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