It also depends on they type of drug test. They can do a "panel" test with a strip and see if there's any illicit drugs (thc, methamphetamine, ......., ......, opiates normal 5 panel, and they have single ones, and 3 panel, etc). However they can test using the mass spectrometer and look for almost anything.
Oh they do make a panel test for smoking cigarettes. I don't remember if it detects nicotine or tobacco.
You could be straightforward with them and ask them what they are looking for. You mention your on pain meds, so am I and I have been tested. As long as you have a valid prescription then there's nothing to worry about with them. If they tell you they're only looking for illegal drugs then you don't have to say anything else. If they tell you they're also testing to see if you smoke, I would pull out your e-cig and explain that you have quit smoking and only use this which contains nicotine. Explain how it works and what it does. After that I would probably try to tell them that I use it every hour to keep my nicotine level constant so you don't have withdrawals and want to go back to smoking and they may possibly be okay with you smoking on the job without taking an outside break (because, even if the law doesn't say you can't vape, it's really up to the management/owner what takes place at that business).
Any other questions, please let me know