http://www.hivguidelines.org/clinical-guidelines/perinatal-transmission/hiv-testing-during-pregnancy-and-at-delivery/
From my quick research in new york state it is mandatory with your consent and if you dont consent they will test the baby right away and they do not need your consent to test the baby.
They tested me twice. Once in the begining and again at 6 months. Idk about legal. They should absolutely never lie about such a thing but it is in best intrest of you and baby to be tested.
Here's why the cdc says all women should be tested:
http://www.cdc.gov/mmwr/preview/mmwrhtml/mm5145a1.htm
Anyway, in doing an internet search, it is a law in many states and just highly recommended in all the others. So, check your specific state's statutes.
good luck
I was wrong. Where i am from (Ontario Canada) It is not mandatory and you can refuse. However in both my pregnancies i was just handed a lab test referral which included hiv among other blood tests! I dont mind since i wouldnt refuse anyways but was unaware that i could refuse. You should be able to google it.