"are cheap semiconductors tested?".
Disclaimer: I work at a place where some of the most expensive semiconductors are developed and produced.
However, even for the most basic, simple, "jelly-bean" diode, it is so trivial to test each and every individual die that it makes no sense to waste the effort and materials to package a known-bad die. I would be astounded if they actually packaged parts before testing them. It is much easier to test die while still on the wafer with automated equipment.
We used to actually apply a tiny dot of ink to die to indicate bad ones that shouldn't be packaged. But automated wafer identification and tracking systems now have the good/bad die information contained in a networked database. So a wafer could have been fabricated but then tested in a place thousands of Km away, and packaged and sorted in yet other far-away locations.
To be sure, there is likely also post-packaging testing to confirm that the assembly process didn't kill the part. And it also seems likely here in the Real World that parametric testing and "binning" happens for economic reasons at the very least.