]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
clear buyer conditions in StoreDiscountAndRefundTest (#35847)
authorMilon <milonpl.git@proton.me>
Sat, 15 Mar 2025 20:58:13 +0000 (21:58 +0100)
committerGitHub <noreply@github.com>
Sat, 15 Mar 2025 20:58:13 +0000 (21:58 +0100)
* fun

* Update Content.IntegrationTests/Tests/StoreTests.cs

Co-authored-by: Hannah Giovanna Dawson <karakkaraz@gmail.com>
* Update Content.IntegrationTests/Tests/StoreTests.cs

Co-authored-by: Hannah Giovanna Dawson <karakkaraz@gmail.com>
---------

Co-authored-by: Hannah Giovanna Dawson <karakkaraz@gmail.com>
Content.IntegrationTests/Tests/StoreTests.cs

index 1f7d357bc05da276259546137930899aee1c4ba7..e6aed787553109d7474a22145066eb790945f8d1 100644 (file)
@@ -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(