How does eating a bat give you a viral disease? How do you test to see if the disease came from the bat?
The virus have infected the tissue in the bat. So if you get some of this tissue in your mouth or eyes the virus may infect your cells as well. Properly cooking it will likely kill the virus but you may still get infected by handling and preparing the animal before it is cooked. So the first human to get the infection might not even have to eat a bat but may be someone who have handled the bat or maybe were just in the same room that the bat were in. Due to these risks scientists are constantly taking samples of various animals to study their infections. This is how we know of a family of viruses called the coronaviruses that have members both infectious to bats and humans. Normally humans can not get infected by bats and bats can not be infected by humans as they are different viruses but sometimes a virus mutates and is able to infect across the species. We do not know exactly how the infection happens and if there are other intermediary animals involved but we suddenly see humans infected with a variant of the virus that is similar to what we previously only saw in bats.
Insofar as the first part of the question, the same way that eating raw eggs infected with salmonella or beef from a cow infected with mad-cow disease can make you sick, if you ingest something that can infect you, then you stand a good chance of contracting that illness.
There are tests that can be performed that can establish the possibility and support likelihood of infection from a particular animal, but I don’t know if testing to specifically prove it; it’s much like a criminal trial, wherein you make reasonable assumption and prove its likelihood beyond a reasonable doubt. (Btw this is why you always hear science talk referring to hypotheses and theories – for a scrupulous scientist to say “prove” really, really means something)
I assume this is about COVID-19. If so, in almost 100% sure it didnt come from eating a bat.
Most recent theories are that it jumped from a bat, to a pangolin, then transferred to a human.
Edit: as for testing, I don’t think there is a test to say “yes it came from this animal”, rather you trace the disease back and look cross reference confirmed cases with animals/sources they’ve been in contact with that carry that specific virus.