The reason everyone doesn't test IQ is that it's not very useful, not that it's legally risky.
People think it is because there's an subtext that everybody would hire straight off IQ scores if they could, which supports a (frankly gross) biological essentialist argument a lot of edgy nerds are fond of. But the whole argument is fractally mythological.