Al-Kāfi - Volume 1 > The Imams (a.s.) do have the knowledge of what was and will be, and that nothing is unknown to them (a.s.)
Hadith #6

6ـ مُحَمَّدُ بْنُ يَحْيَى عَنْ أَحْمَدَ بْنِ مُحَمَّدٍ عَنْ عُمَرَ بْنِ عَبْدِ الْعَزِيزِ عَنْ مُحَمَّدِ بْنِ الْفُضَيْلِ عَنْ أَبِي حَمْزَةَ قَالَ سَمِعْتُ أَبَا جَعْفَرٍ (عَلَيْهِ السَّلام) يَقُولُ لا وَالله لا يَكُونُ عَالِمٌ جَاهِلاً أَبَداً عَالِماً بِشَيْ‏ءٍ جَاهِلاً بِشَيْ‏ءٍ ثُمَّ قَالَ الله أَجَلُّ وَأَعَزُّ وَأَكْرَمُ مِنْ أَنْ يَفْرِضَ طَاعَةَ عَبْدٍ يَحْجُبُ عَنْهُ عِلْمَ سَمَائِهِ وَأَرْضِهِ ثُمَّ قَالَ لا يَحْجُبُ ذَلِكَ عَنْهُ.

6. Muhammad ibn Yahya has narrated from Ahmad ibn Muhammad from ‘Umar ibn ‘Abd al-‘Aziz from Muhammad ibn al-Fudayl from abu Hamzah who has that he heard abu Ja‘far (a.s.) say the following. “No, I swear by Allah, the scholar (who possesses Divine authority) is never ignorant or knowledgeable in something and ignorant of other things. The Imam (a.s.) then said, “Allah, the Most Holy, Most High and Most Gracious, is far exalted and above imposing the obedience of a servant (of His) on the others and then hide the knowledge of things in the heavens and on earth from him and then say, “Do not hide that from him.”