Skip to content
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

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

henry-tp
Copy link
Contributor

@henry-tp henry-tp commented Feb 11, 2025

WEB-3418

  • Awaiting partner integration before merge

@henry-tp henry-tp changed the base branch from develop to WEB-3397-mobile-views February 11, 2025 18:58
@henry-tp henry-tp mentioned this pull request Feb 11, 2025
@henry-tp henry-tp marked this pull request as ready for review February 11, 2025 19:22
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',
};
Copy link
Contributor Author

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.

Base automatically changed from WEB-3397-mobile-views to develop February 12, 2025 22:27
@@ -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 });
Copy link
Contributor Author

@henry-tp henry-tp Feb 13, 2025

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.

@henry-tp
Copy link
Contributor Author

/deploy qa1

@tidebot
Copy link
Collaborator

tidebot commented Feb 13, 2025

henry-tp updated values.yaml file in qa1

@tidebot
Copy link
Collaborator

tidebot commented Feb 13, 2025

henry-tp updated flux policies file in qa1

@tidebot
Copy link
Collaborator

tidebot commented Feb 13, 2025

henry-tp deployed blip WEB-3418-mobile-safari branch to qa1 namespace

@henry-tp henry-tp changed the title WEB-3418 - Enable Safari on Mobile [WEB-3418] - Enable Safari on Mobile Feb 13, 2025
@henry-tp henry-tp requested a review from krystophv February 13, 2025 22:44
Copy link
Member

@krystophv krystophv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, LGTM 🚢

@henry-tp henry-tp changed the title [WEB-3418] - Enable Safari on Mobile [WEB-3418] - Enable Safari on Mobile [DON'T MERGE] Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants