From: Milon Date: Sat, 15 Mar 2025 20:58:13 +0000 (+0100) Subject: clear buyer conditions in StoreDiscountAndRefundTest (#35847) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=7f4672f9634345b0f74158ea7253b70d19c84caf;p=space-station-14.git clear buyer conditions in StoreDiscountAndRefundTest (#35847) * fun * Update Content.IntegrationTests/Tests/StoreTests.cs Co-authored-by: Hannah Giovanna Dawson * Update Content.IntegrationTests/Tests/StoreTests.cs Co-authored-by: Hannah Giovanna Dawson --------- Co-authored-by: Hannah Giovanna Dawson --- diff --git a/Content.IntegrationTests/Tests/StoreTests.cs b/Content.IntegrationTests/Tests/StoreTests.cs index 1f7d357bc0..e6aed78755 100644 --- a/Content.IntegrationTests/Tests/StoreTests.cs +++ b/Content.IntegrationTests/Tests/StoreTests.cs @@ -102,6 +102,12 @@ public sealed class StoreTests + $"flag as 'true'. This marks the fact that cost modifier of discount is not applied properly!" ); + // The storeComponent returns discounted items with conditions randomly, so we remove these to sanitize the data. + foreach (var discountedItem in discountedListingItems) + { + discountedItem.Conditions = null; + } + // Refund action requests re-generation of listing items so we will be re-acquiring items from component a lot of times. var itemIds = discountedListingItems.Select(x => x.ID); foreach (var itemId in itemIds) @@ -140,6 +146,9 @@ public sealed class StoreTests // get refreshed item after refund re-generated items discountedListingItem = storeComponent.FullListingsCatalog.First(x => x.ID == itemId); + // The storeComponent can give a discounted item a condition at random, so we remove it to sanitize the data. + discountedListingItem.Conditions = null; + var afterRefundBalance = storeComponent.Balance[UplinkSystem.TelecrystalCurrencyPrototype]; Assert.That(afterRefundBalance.Value, Is.EqualTo(originalBalance.Value), "Expected refund to return all discounted cost value."); Assert.That(