react-device-detect icon indicating copy to clipboard operation
react-device-detect copied to clipboard

Testing using the approach described in README doesn't work with <BrowserView>

Open tadejmagajna opened this issue 4 years ago • 1 comments

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 avatar Sep 03 '20 17:09 tadejmagajna

@tadejmagajna I see the problem now. Will think on how to resolve it

duskload avatar Sep 05 '20 08:09 duskload