Urine tests are just for the typical recreational drugs. No need to worry there.
Background checks, Also Known As, aka, criminal background checks are just that. Some places may also run a credit check. Since you have a legal name change, that is a part of the public record and will likely pop up, especially since your serial number is the all important linkage to your existence in today's world. Names are meaningless to the Great God of the Electron. HR will likely hand you a form to fill out providing any aliases of aka's which just makes life easier for whoever is running the check. With no criminal background they hopefully will be discrete about your name change since it is outside the scope of the inquiry.
All bets are off if any background check, current or future, may lead to needing a national security clearance with it's 30 page questionnaire even wanting to know your shoe sizes for the past 10 years

You will need to come clean there (or risk jail). On the plus side, their hands are definitely tied since being trans is officially not a national security risk in most countries