Verify order selection through real window controls and modal replacement
This commit is contained in:
1 parent
a1c65119a2
commit
13b4665ed2
4 files changed
+89
-14
No files matched your search
@@ -74,8 +74,8 @@ struct [[= Void::Testing::name("ProductionCommandsTests")]] ProductionCommandsTe
|
||||
|
||||
Test ProductionCommandsTests::exact_results_and_conflicts_use_durable_ids() {
|
||||
World world(43, 32, 32, 1, ExecutionMode::SerialReference);
|
||||
world.queue_production({8, 8}, RecipeId::BuildCabin);
|
||||
world.queue_production({8, 8}, RecipeId::BuildCabin);
|
||||
world.queue_production({8, 8}, RecipeId::SawPlank);
|
||||
world.queue_production({8, 8}, RecipeId::SawPlank);
|
||||
const auto first = world.production_orders().front().id;
|
||||
const auto second = world.production_orders().back().id;
|
||||
CommandDispatcher dispatcher(identity());
|
||||
@@ -219,6 +219,10 @@ Test ProductionCommandsTests::resume_keeps_partial_bed_and_installed_loom_identi
|
||||
require(world.find_production(id) && world.find_production(id)->suspended &&
|
||||
world.find_production(id)->bed_stage == stage && !world.can_place_storage({9, 3}),
|
||||
"cancel removed installed progress or its occupied site");
|
||||
const auto suspended_cancel = envelope(dispatcher.next_request(host), CancelProductionPayload{id});
|
||||
const auto busy = dispatcher.dispatch(world, host, suspended_cancel);
|
||||
require(busy.status == DispatchStatus::Completed && busy.command_status == CommandStatus::Busy &&
|
||||
dispatcher.dispatch(world, host, suspended_cancel) == busy);
|
||||
for (int tick = 0; tick < 5; ++tick) world.step();
|
||||
const auto resume = envelope(dispatcher.next_request(host), ResumeProductionPayload{id});
|
||||
const auto resumed = dispatcher.dispatch(world, host, resume);
|
||||
@@ -226,6 +230,8 @@ Test ProductionCommandsTests::resume_keeps_partial_bed_and_installed_loom_identi
|
||||
require(world.find_production(id) && !world.find_production(id)->suspended &&
|
||||
world.find_production(id)->bed_stage == stage && dispatcher.dispatch(world, host, resume) == resumed &&
|
||||
world.next_command_sequence(1) == sequence && !before_cancel->find_production(id)->suspended);
|
||||
require(dispatcher.dispatch(world, host, suspended_cancel) == busy && !world.find_production(id)->suspended,
|
||||
"old refused cancellation changed after the same durable order was resumed");
|
||||
world.stock_storage(storage, bed ? ItemType::Cloth : ItemType::Flax, 2);
|
||||
step_until(world, [&] { return bed ? world.find_production(id)->state == JobState::Completed :
|
||||
world.find_storage(storage)->item_count(ItemType::Cloth) > 0; });
|
||||
@@ -233,7 +239,7 @@ Test ProductionCommandsTests::resume_keeps_partial_bed_and_installed_loom_identi
|
||||
"resume charged for an already installed stage twice");
|
||||
if (bed) {
|
||||
const auto refused = send(world, dispatcher, CancelProductionPayload{id});
|
||||
require(refused.command_status == CommandStatus::InvalidTarget,
|
||||
require(refused.command_status == CommandStatus::Busy,
|
||||
"completed final bed accepted cancel");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user