update safari tests

This commit is contained in:
Kyle Spearrin 2019-08-13 12:53:57 -04:00
parent fba1731cb4
commit d585c21c38
1 changed files with 6 additions and 6 deletions

View File

@ -5,19 +5,19 @@ import { DeviceType } from 'jslib/enums';
describe('Browser Utils Service', () => {
describe('getBrowser', () => {
const originalUserAgent = navigator.userAgent;
const originalSafari = (window as any).safari;
const originalSafariAppExtension = (window as any).safariAppExtension;
const originalOpr = (window as any).opr;
// Reset the userAgent.
afterAll(() => {
Object.defineProperty(navigator, 'userAgent', {
value: originalUserAgent
value: originalUserAgent,
});
Object.defineProperty(window, 'safari', {
value: originalSafari
value: originalSafariAppExtension,
});
Object.defineProperty(window, 'opr', {
value: originalOpr
value: originalOpr,
});
});
@ -72,9 +72,9 @@ describe('Browser Utils Service', () => {
value: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/602.4.8 (KHTML, like Gecko) Version/10.0.3 Safari/602.4.8'
});
Object.defineProperty(window, 'safari', {
Object.defineProperty(window, 'safariAppExtension', {
configurable: true,
value: {}
value: true,
});
const browserPlatformUtilsService = new BrowserPlatformUtilsService(null, null);