Fix tests (#27711)
* Fix tests * Fix test fail * Apply same fix to other tests
This commit is contained in:
@@ -5,6 +5,7 @@ using Content.Shared.Stacks;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
using static Robust.UnitTesting.RobustIntegrationTest;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.Interaction;
|
||||
|
||||
@@ -111,7 +112,7 @@ public abstract partial class InteractionTest
|
||||
/// <summary>
|
||||
/// Convert applicable entity prototypes into stack prototypes.
|
||||
/// </summary>
|
||||
public void ConvertToStacks(IPrototypeManager protoMan, IComponentFactory factory)
|
||||
public async Task ConvertToStacks(IPrototypeManager protoMan, IComponentFactory factory, ServerIntegrationInstance server)
|
||||
{
|
||||
if (Converted)
|
||||
return;
|
||||
@@ -130,14 +131,17 @@ public abstract partial class InteractionTest
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!entProto.TryGetComponent<StackComponent>(factory.GetComponentName(typeof(StackComponent)),
|
||||
out var stackComp))
|
||||
StackComponent? stack = null;
|
||||
await server.WaitPost(() =>
|
||||
{
|
||||
entProto.TryGetComponent(factory.GetComponentName(typeof(StackComponent)), out stack);
|
||||
});
|
||||
|
||||
if (stack == null)
|
||||
continue;
|
||||
}
|
||||
|
||||
toRemove.Add(id);
|
||||
toAdd.Add((stackComp.StackTypeId, quantity));
|
||||
toAdd.Add((stack.StackTypeId, quantity));
|
||||
}
|
||||
|
||||
foreach (var id in toRemove)
|
||||
|
||||
Reference in New Issue
Block a user