they might be testing only for instances like you describe above. It's a lot more of a gray area now.
"Most significant to the new rule changes, a UFC athlete who tests positive for carboxy-THC (the main psychoactive component in cannabis)
will face a violation by USADA only if evidence demonstrates the substance was taken for performance-enhancing purposes such as alleviating pain or anxiety; otherwise the athlete will not be eligible for sanction. A positive test for the prohibited substance, THC, will result in an atypical finding that will only be deemed a violation if it meets the aforementioned condition."
https://ufc.usada.org/changes-to-ufc-anti-doping-policy-prohibited-list/