In the run-up to the elections, pollsters were forecasting the downfall of the country’s Islamic parties.