Tests: Add case covering transitive find_dependency calls

Issue: #23685
8 files changed