# `Cyclium.Test.WorkflowCase`
[🔗](https://github.com/Cyclium/cyclium_ex/blob/main/lib/cyclium/test/workflow_case.ex#L1)

Test helpers for validating workflow definitions.

Checks DAG validity, step input functions, failure policy coverage,
and structural correctness for both compiled and dynamic workflows.

## Usage

    defmodule MyApp.Workflows.VendorOnboardingTest do
      use ExUnit.Case, async: true
      use Cyclium.Test.WorkflowCase

      test "workflow is valid" do
        assert_valid_workflow(MyApp.Workflows.VendorOnboarding)
      end

      test "step inputs don't crash" do
        assert_step_inputs_safe(MyApp.Workflows.VendorOnboarding,
          trigger: %{"vendor_id" => "v123"}
        )
      end
    end

# `assert_failure_policies_complete`
*macro* 

Assert that every step has a failure policy defined. Useful for
enforcing that teams explicitly handle failures for all steps.

# `assert_failure_policies_valid`
*macro* 

Assert that all failure policies reference existing steps and use
valid policy types.

# `assert_step_inputs_safe`
*macro* 

Assert that all step input functions execute without crashing for
the given trigger payload. Uses empty prior results for root steps
and mock prior results for dependent steps.

## Options

  * `:trigger` — trigger payload map (required)
  * `:prior` — mock prior step results (default: auto-generated empty maps)

# `assert_valid_workflow`
*macro* 

Assert that a workflow module has a valid definition: trigger set,
steps form a DAG, no duplicate IDs, all depends_on references exist.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
