So Iran probably was a relatively short amount of time away from having a bomb. They probably just feared what would happen if they tested it.
Another important detail, there are basically 2 different ways to make a bomb...the U-235 way and the Pu-239 way. The first takes lots and lots of time but a bit less technical skill. The second takes far less time but a bit more skill. Its likely the Iranians had the skill to do either.
There are probably 2 dozen countries that were 30 years ago, today and will be in the future about 6 months from having a bomb. They have all the pieces but won't do the final assembly unless they fear a nuclear exchange involving them. They don't do those final steps because of the negative consequences to doing them.
PS Remember, we built two different types of bombs with less computing power than a pocket calculator.
PPS Your understanding of these issues is completely wrong. The JCPA was more of a stop gap than anything. Saying Trump is handling everything correctly is wrong but so is saying that leaving the JCPA in place was a good idea. It was just the best Obama could negotiate because nobody thought he had the guts to invade Iran.