You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Apply prettier formatting
This commit is contained in:
@@ -26,7 +26,7 @@ const makeDeviceExtendedInfo = (
|
||||
deviceType,
|
||||
deviceModel,
|
||||
deviceOperatingSystem,
|
||||
client: clientName && [clientName, clientVersion].filter(Boolean).join(' '),
|
||||
client: clientName && [clientName, clientVersion].filter(Boolean).join(" "),
|
||||
});
|
||||
|
||||
/* eslint-disable max-len */
|
||||
@@ -66,7 +66,7 @@ const IOS_EXPECTED_RESULT = [
|
||||
];
|
||||
const DESKTOP_UA = [
|
||||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102" +
|
||||
" Electron/20.1.1 Safari/537.36",
|
||||
" Electron/20.1.1 Safari/537.36",
|
||||
"Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) ElementNightly/2022091301 Chrome/104.0.5112.102 Electron/20.1.1 Safari/537.36",
|
||||
];
|
||||
const DESKTOP_EXPECTED_RESULT = [
|
||||
@@ -98,7 +98,6 @@ const WEB_EXPECTED_RESULT = [
|
||||
makeDeviceExtendedInfo(DeviceType.Web, "Apple iPad", "iOS", "Mobile Safari", "8.0"),
|
||||
makeDeviceExtendedInfo(DeviceType.Web, "Apple iPhone", "iOS", "Mobile Safari", "8.0"),
|
||||
makeDeviceExtendedInfo(DeviceType.Web, "Samsung SM-G973U", "Android", "Chrome", "69.0.3497.100"),
|
||||
|
||||
];
|
||||
|
||||
const MISC_UA = [
|
||||
@@ -119,8 +118,8 @@ const MISC_EXPECTED_RESULT = [
|
||||
];
|
||||
/* eslint-disable max-len */
|
||||
|
||||
describe('parseUserAgent()', () => {
|
||||
it('returns deviceType unknown when user agent is falsy', () => {
|
||||
describe("parseUserAgent()", () => {
|
||||
it("returns deviceType unknown when user agent is falsy", () => {
|
||||
expect(parseUserAgent(undefined)).toEqual({
|
||||
deviceType: DeviceType.Unknown,
|
||||
});
|
||||
@@ -132,17 +131,15 @@ describe('parseUserAgent()', () => {
|
||||
const testCases: TestCase[] = userAgents.map((userAgent, index) => [userAgent, results[index]]);
|
||||
|
||||
describe(platform, () => {
|
||||
it.each(
|
||||
testCases,
|
||||
)('Parses user agent correctly - %s', (userAgent, expectedResult) => {
|
||||
it.each(testCases)("Parses user agent correctly - %s", (userAgent, expectedResult) => {
|
||||
expect(parseUserAgent(userAgent)).toEqual(expectedResult);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
testPlatform('Android', ANDROID_UA, ANDROID_EXPECTED_RESULT);
|
||||
testPlatform('iOS', IOS_UA, IOS_EXPECTED_RESULT);
|
||||
testPlatform('Desktop', DESKTOP_UA, DESKTOP_EXPECTED_RESULT);
|
||||
testPlatform('Web', WEB_UA, WEB_EXPECTED_RESULT);
|
||||
testPlatform('Misc', MISC_UA, MISC_EXPECTED_RESULT);
|
||||
testPlatform("Android", ANDROID_UA, ANDROID_EXPECTED_RESULT);
|
||||
testPlatform("iOS", IOS_UA, IOS_EXPECTED_RESULT);
|
||||
testPlatform("Desktop", DESKTOP_UA, DESKTOP_EXPECTED_RESULT);
|
||||
testPlatform("Web", WEB_UA, WEB_EXPECTED_RESULT);
|
||||
testPlatform("Misc", MISC_UA, MISC_EXPECTED_RESULT);
|
||||
});
|
||||
|
Reference in New Issue
Block a user