react-device-detect
react-device-detect copied to clipboard
Testing using the approach described in README doesn't work with <BrowserView>
Testing using the approach described in README where we:
import * as rdd from 'react-device-detect';
rdd.isMobile = true;
doesn't really work with the <BrowserView>
component. In tests where I use jest
, regardless of whether I set isMobile
to true
or isBrowser
to false
, tests will always render like a non-mobile browser.
I had to write my own component that uses the isBrowser
variable to overcome this issue. It would be nice if <BrowserView>
was testable out of the box.
@tadejmagajna I see the problem now. Will think on how to resolve it