From 46f0efe463e95c7ed842d2adca6fece51c87016b Mon Sep 17 00:00:00 2001 From: Sag Date: Thu, 30 May 2024 06:25:50 +0200 Subject: [PATCH] Fixed flaky Portal test (#20286) no issue - the signup flow tests check whether the benefits of the available tiers are rendering correctly. The test is based on a text match, which sometimes fails because of duplicate benefit descriptions - this fix makes the benefit descriptions less likely to be the same, by using a timestamp in the randomisation function --- apps/portal/src/utils/fixtures-generator.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/portal/src/utils/fixtures-generator.js b/apps/portal/src/utils/fixtures-generator.js index f831eefcd7..5f850686f4 100644 --- a/apps/portal/src/utils/fixtures-generator.js +++ b/apps/portal/src/utils/fixtures-generator.js @@ -261,13 +261,14 @@ export function getFreeProduct({ } export function getBenefits({numOfBenefits}) { + const timestamp = Date.now(); const random = Math.floor(Math.random() * 100); const beenfits = [ - getBenefitData({name: `Limited early adopter pricing #${random}`}), - getBenefitData({name: `Latest gear reviews #${random}`}), - getBenefitData({name: `Weekly email newsletter #${random}`}), - getBenefitData({name: `Listen to my podcast #${random}`}) + getBenefitData({name: `Limited early adopter pricing #${random}-${timestamp}`}), + getBenefitData({name: `Latest gear reviews #${random}-${timestamp}`}), + getBenefitData({name: `Weekly email newsletter #${random}-${timestamp}`}), + getBenefitData({name: `Listen to my podcast #$${random}-${timestamp}`}) ]; return beenfits.slice(0, numOfBenefits); }