An easy way to test the battery itself is to plug the phone into the computer and install the free third party software 3utools and check out the battery data. Coconut battery is similar for macs.
Tristar, the usb permission chip, is a really common fault in phones. The Apple cables and the bona fide Made for iPhone/iPad/iPod cables have a protection chip on a teeny circuit board at the end of the cable. The copy cables, or ones sold as if they are certified but are in fact fake (this is also really common) do NOT have the protection chip and pass through surges/noise/ripple which damages the brain-like decision making chip—tristar. In the old days of iPhone 5 when this chip first came on the radar screen, tristar was called U2. This name is no longer appropriate since tristar is no longer in the U2 board position, and we don’t want to accidentally change the wrong chip!
If a usb ammeter has verified that the charging block, cable, and lightning port are working on another device, then this point to tristar faults. Tristar is a bread and butter microsoldering job that you should be able to find a local shop that is familiar with the problem, if not, then mail in logic board repair.