I honestly don't think it will be in the baby's system by the time she delivers. That would be very rare,but if such an occasion arises the social worker will see that she is clean and changing her life. Good luck to her
Every state has different regulation and it may vary from hospital to hospital. It can also depend on your friend's OB/midwife. What they do can very much depend on your friend herself, if she got regular and early prenatal care, was cooperative and followed all her instructions; if she presented herrself as a caring and cared for mother to be, then there may not be any reason for them to test her. However if she or those around her send out warning signals with their presentation, dress or behavior, her health provider can very well test her baby's meconium (poop) without her consent. They can not test her without her express consent and knowledge.
You should be aware that baby's meconium will show every drug the pregnant woman have used from the 20th week of pregnancy.
But you should relax they do not just take babies away from their mothers unless there are major indicators for doing so. If she behaves in a measured, reasonable manner, dresses appropriately, shows that she is taking care of herself, thus of the baby, I'm sure it will be fine.
Please read and have her read my blog on pregnancy and addiction by clicking on my name in blue and than "blogs". Good luck to her.