Is this how you detect jQuery in tests? Should I do it differently?