Do electronics distributers test each component before sending them out?
If you are talking about IC's, yes, manufacturers (not distributors) normally test 100% of the IC's as part of the production process. As far as I know, this applies regardless of country of manufacture. Distributors don't test anything. That is not their job.

Manufacturers may not test 100% of the features in a product, but they will test the product in some fashion. At a minimum, they will test each component on the wafer and discard bad components prior to packaging. (Wafer sort). The extent of post-packaging test probably varies depending on complexity of the product, etc.

I think it is relatively unusual for electronics products factories to test incoming electronic components prior to PCB assembly. You might have an acceptance test for things like speakers or LCD displays, but not for the components soldered to the PCB. If something like that is required, you would probably modify the design to exclude the troublesome part, or work with the manufacturer to improve outgoing quality.

It is certainly possible to be taken advantage of in China. But there are quite a few perfectly good suppliers of all kinds in China. Everything is built there, and there is a vast industrial supply chain in China. Taiwan is maybe one step up in quality and reliability compared with mainland China (PRC). But China is much bigger.

One thing you should DEFINITELY NOT do in China is buy major brand parts through gray market channels. There is a lot of fraud and counterfeiting going on. If you buy major brands, buy through authorized distributors only.