We recently had this situation in our game: The group's barbarian was attacked by an enemy fighter using the Intimidating Strike feat (CRB p. 146) while the barbarian was protected by a Spiritual Guardian (CRB p. 373) spell, which prevented the barbarian from taking damage.
What would happen now?
a) the Spiritual Guardian took damage, so it gets the frightened condition, while the barbarian, who did not take damage, does not get the frightened condition
b) The attack hit and dealt damage (to the Guardian, but it did deal damage) so the target of the attack (the barbarian) gets the frightened condition - this would be the literal interpretation of the second sentence describing Intimidating Strike
c) the attack dealt damage to the Guardian, but he wasn't the target of the attack, so it does not get the frightened condition, and it dealt no damage to the barbarian (the target of the attack), so she does not get the frightened condition either
Also, what would happen if both were dealt damage?
1) both would get the frightened condition (as implied by the first sentence in the description of the feat)
2) only the target of the attack would get the frightened condition