For those wondering about this, I recommend some of the electronics factory tour videos on the YouTube channel Strange Parts. Even a small component manufacturer will generally have automated inspection of in-progress items on the line, automated test harnesses for functionality testing, x-ray machines for verifying connections, human QA of a subset of final products for functionality, and human QA of final product aesthetics. An interesting note on this is that it's getting noticeably more automated over time thanks to improvements in computer vision, cameras, and sensors.