From 6cf8f805cafc0ba66f88e05e3620e0a4155e88bb Mon Sep 17 00:00:00 2001 From: Winkarst-cpu <74284083+Winkarst-cpu@users.noreply.github.com> Date: Fri, 15 Aug 2025 08:46:27 +0300 Subject: [PATCH] Add integration test for MobPriceComponent (#39524) Test --- Content.IntegrationTests/Tests/CargoTest.cs | 24 +++++++++++++++++++ .../Entities/Clothing/Head/misc.yml | 4 +++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Content.IntegrationTests/Tests/CargoTest.cs b/Content.IntegrationTests/Tests/CargoTest.cs index fd0cedac73..3b5afaa3af 100644 --- a/Content.IntegrationTests/Tests/CargoTest.cs +++ b/Content.IntegrationTests/Tests/CargoTest.cs @@ -5,7 +5,9 @@ using Content.Server.Cargo.Components; using Content.Server.Cargo.Systems; using Content.Server.Nutrition.Components; using Content.Server.Nutrition.EntitySystems; +using Content.Shared.Body.Components; using Content.Shared.Cargo.Prototypes; +using Content.Shared.Mobs.Components; using Content.Shared.Prototypes; using Content.Shared.Stacks; using Content.Shared.Whitelist; @@ -254,4 +256,26 @@ public sealed class CargoTest await pair.CleanReturnAsync(); } + + [Test] + public async Task MobPrice() + { + await using var pair = await PoolManager.GetServerClient(); + + var componentFactory = pair.Server.ResolveDependency(); + + await pair.Server.WaitAssertion(() => + { + Assert.Multiple(() => + { + foreach (var (proto, comp) in pair.GetPrototypesWithComponent()) + { + Assert.That(proto.TryGetComponent(out _, componentFactory), $"Found MobPriceComponent on {proto.ID}, but no BodyComponent!"); + Assert.That(proto.TryGetComponent(out _, componentFactory), $"Found MobPriceComponent on {proto.ID}, but no MobStateComponent!"); + } + }); + }); + + await pair.CleanReturnAsync(); + } } diff --git a/Resources/Prototypes/Entities/Clothing/Head/misc.yml b/Resources/Prototypes/Entities/Clothing/Head/misc.yml index de674a1754..094e60a7c9 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/misc.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/misc.yml @@ -196,7 +196,9 @@ sprite: Clothing/Head/Misc/fancycrown.rsi - type: Clothing sprite: Clothing/Head/Misc/fancycrown.rsi - - type: MobPrice + - type: TypingIndicatorClothing + proto: regal + - type: StaticPrice price: 3000 # - type: AddAccentClothing # DeltaV - remove clothing-forced accents # accent: MobsterAccent