Doesn't Tesla have a factory in China?
They do. Because Elon is proving himself to be quite an idiot.
China was more than happy to welcome him in, and have him teach them how to build an EV. They simply copied what they could and improved on it.
"The communists will happily sell the capitalists the rope the capitalists hang themselves with"
They do. The Chinese government gave them a special exemption, presumably because they wanted to build EV manufacturing expertise. Other foreign auto companies are not allowed to open their own factories in China; they have to do a joint venture with a local manufacturer.