Hi,
Try creating a Win 10 battery report to check the status of the battery. Look at design capacity versus full charge capacity
If the laptop is giving no indication that it is being powered by the charger first check that there is +19.5V DC at the output of the charger. If there is, then flex the charger cord at both the charger end and where it enters the plug to ensure that the output is steady. If you don’t have a DMM (digital multimeter) then try a different compatible charger and check if it always works
If the charger is OK then perhaps the DC-In jack may be faulty or loose from the systemboard.
Here’s a video that may help. it shows how to open the laptop so that the DC-In jack can first be checked to see if it is loose and then how to replace it if it was faulty.