Factorize visit chains in tests