Skip to content

Commit

Permalink
update config prices and corresponding tests (#902)
Browse files Browse the repository at this point in the history
Co-authored-by: Šimon Macek <[email protected]>
  • Loading branch information
maceksimon and Šimon Macek authored Jan 31, 2025
1 parent 6cb9cad commit f05920b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ride_to_work_by_bike_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ defaultDistanceZero = "0.00"

# Challenge registration
entryFeePaymentMax = "2000"
entryFeePaymentOptions = "500,700"
entryFeePaymentOptions = "850,1500"
rtwbbChallengeEntryFeeOrderedProductName = "RTWBB challenge entry fee"
rtwbbDonationOrderedProductName = "RTWBB donation"
checkRegisterChallengeStatusIntervalSeconds = 20
Expand Down
3 changes: 2 additions & 1 deletion src/components/__tests__/RegisterChallengePayment.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ const selectorVoucherInput = 'form-field-voucher-input';

// variables
const borderRadiusCardSmall = rideToWorkByBikeConfig.borderRadiusCardSmall;
const prices = rideToWorkByBikeConfig.entryFeePaymentOptions.split(',');
let defaultPaymentAmountMin = 0;
const defaultPaymentAmountMax = parseInt(
rideToWorkByBikeConfig.entryFeePaymentMax,
);
const sliderClickTolerance = 10;
const testNumberValue = 500;
const testNumberValue = prices[0];
const { formatPriceCurrency } = useFormatPrice();

// colors
Expand Down
7 changes: 6 additions & 1 deletion test/cypress/e2e/register_challenge.spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ const activeIconImgSrcStepper7 = new URL(
).href;
const doneIconImgSrcStepper7 = doneIcon;

const paymentAmountDonation = 500;
let prices;
let paymentAmountDonation;

describe('Register Challenge page', () => {
let defaultPaymentAmountMin = 0;
Expand All @@ -108,6 +109,10 @@ describe('Register Challenge page', () => {
defaultPaymentAmountMin =
currentPriceLevels[PriceLevelCategory.basic].price;
});
cy.task('getAppConfig', process).then((config) => {
prices = config.entryFeePaymentOptions.split(',');
paymentAmountDonation = prices[0];
});
});

context('desktop', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/fixtures/apiPostPayuCreateOrderRequest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"amount": 500,
"amount": 850,
"client_ip": "185.250.215.37"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"amount": 500,
"amount": 850,
"client_ip": "185.250.215.37",
"payment_subject": "individual",
"payment_category": "entry_fee-donation",
Expand All @@ -11,7 +11,7 @@
},
{
"name": "RTWBB donation",
"unitPrice": 110,
"unitPrice": 460,
"quantity": 1
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"amount": 500,
"amount": 850,
"client_ip": "185.250.215.37",
"payment_subject": "voucher",
"payment_category": "entry_fee-donation",
Expand All @@ -11,7 +11,7 @@
},
{
"name": "RTWBB donation",
"unitPrice": 305,
"unitPrice": 655,
"quantity": 1
}
]
Expand Down

0 comments on commit f05920b

Please sign in to comment.