-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WEB-3418] - Enable Safari on Mobile [DON'T MERGE] #1513
base: develop
Are you sure you want to change the base?
Conversation
safariMac: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 14_7_3) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15', | ||
safariIPhone: 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_7_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Mobile/15E148 Safari/604.1', | ||
safariIPad: 'Mozilla/5.0 (iPad; CPU OS 17_7_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Mobile/15E148 Safari/604.1', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the value / longevity of these tests given that they capture only a specific device. But I feel like we should have something.
@@ -12,7 +12,8 @@ import appContext from '../../app/bootstrap'; | |||
|
|||
describe('appContext', () => { | |||
before(() => { | |||
Object.defineProperty(window.navigator, 'userAgent', { value: 'Mozilla/5.0 .. truncated .. Chrome/131.0.0.0' }); | |||
const userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36'; | |||
Object.defineProperty(window.navigator, 'userAgent', { value: userAgent, configurable: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They key change here is the addition of configurable: true
. I found that if configurable
is not set to true, Object.defineProperty()
cannot be called again with window.navigator
, so setting configurable: true
allows us to re-define the property.
Unfortunately, defineProperty
is called in one file, the effect seems to bleed into other test files as well, as the test runner is not restarting for every new file. That's why I needed to make an adjustment here.
/deploy qa1 |
henry-tp updated values.yaml file in qa1 |
henry-tp updated flux policies file in qa1 |
henry-tp deployed blip WEB-3418-mobile-safari branch to qa1 namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, LGTM 🚢
WEB-3418