Skip to content

Add test for sequential customBlocks

In a structure like:

  • MainBlock
    • CustomBlock_1
      • SomeBlock_1-1
      • SomeBlock_1-2
    • CustomBlock_2
      • SomeBlock_2-1
      • SomeBlock_2-2
      • SomeBlock_2-3

it might be smart to add a test to verify, that when MainBlock is triggered, first SomeBlock_1-1 and SomeBlock_1-2 are triggered in sequence before any of CustomBlock_2's contents get called.

The idea would be to add a new "recording" type of DummyBlock with a custom name and have handleAction write that name into a share buffer. That way it would be possible to assert the execution order along the lines of

parent.handleAction(controller).map { _ =>
  assertEquals(
    DummyBlock.calls.toList,
    List("A", "B"),
    "Child A must complete before child B is even started"
  )
}