USSR had "elections". They were "free". Just ask 'em ...
Communism is and was completely a product of the so-called enlightenment. PRC and USSR came into being as the result of communist revolutions.
Just because they used the word “election” doesn’t mean they were elections, anymore than the Westboro Baptist Church is counts a “Baptist” or “Christian.”
In the USSR, a small minority seized control through revolution, unchecked by a poorly designed democratic process. Once they had control, there was nothing democratic about their government. The PRC took control through armed revolution, without even a pretense of democracy.
Communism may in a sense be a product of the Enlightenment, in the same way Islam is a product of Christianity and Judaism, but those countries most strongly influenced by the Enlightenment were the ones that stood most strongly against communism in the 20th century.