If you had an intermittent internal connection in the battery, and it was tested while the connection was good, it would test as a good battery. But then on the other hand an open in the battery should not stop a running engine UNLESS, at idle the charging system output was less than the power demands of everything that was drawing power on the bike at that time. It is common to be running off the battery at idle with everything turned on.
Simple check, Measure the voltage across the battery with the engine above 3,000 RPM. as long as it is about 14V you are charging correctly.