mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-29 23:57:29 +00:00
Don't enqueue construction events without validation (#39869)
This commit is contained in:
committed by
Vanessa
parent
28f8d6dd22
commit
32f018e804
@@ -0,0 +1,49 @@
|
||||
using Content.IntegrationTests.Tests.Interaction;
|
||||
using Content.Server.Construction.Components;
|
||||
using Content.Shared.Temperature;
|
||||
|
||||
namespace Content.IntegrationTests.Tests.Construction.Interaction;
|
||||
|
||||
public sealed class EdgeClobbering : InteractionTest
|
||||
{
|
||||
[TestPrototypes]
|
||||
private const string Prototypes = @"
|
||||
- type: constructionGraph
|
||||
id: ExampleGraph
|
||||
start: A
|
||||
graph:
|
||||
- node: A
|
||||
edges:
|
||||
- to: B
|
||||
steps:
|
||||
- tool: Anchoring
|
||||
doAfter: 1
|
||||
- to: C
|
||||
steps:
|
||||
- tool: Screwing
|
||||
doAfter: 1
|
||||
- node: B
|
||||
- node: C
|
||||
|
||||
- type: entity
|
||||
id: ExampleEntity
|
||||
components:
|
||||
- type: Construction
|
||||
graph: ExampleGraph
|
||||
node: A
|
||||
|
||||
";
|
||||
|
||||
[Test]
|
||||
public async Task EnsureNoEdgeClobbering()
|
||||
{
|
||||
await SpawnTarget("ExampleEntity");
|
||||
var sTarget = SEntMan.GetEntity(Target!.Value);
|
||||
|
||||
await InteractUsing(Screw, false);
|
||||
SEntMan.EventBus.RaiseLocalEvent(sTarget, new OnTemperatureChangeEvent(0f, 0f, 0f));
|
||||
await AwaitDoAfters();
|
||||
|
||||
Assert.That(SEntMan.GetComponent<ConstructionComponent>(sTarget).Node, Is.EqualTo("C"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user