>Cosmetics are potentially harmful to humans, and that harm can be prevented by testing on animals first.
I think the idea was "unless is needed to avoid harm" in general, not "unless is needed to avoid harm caused by people using a non-essential product".
E.g. curing cancer is OK, making BS products like cosmetics safer is pushing it as a justification (since those could just, like, not be made in the first place).