Skip to content

Commit

Permalink
chore(added honeywell rt10a in tablet section)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsinayaz authored and AhsanAyaz committed May 26, 2021
1 parent d32cca1 commit 368a76d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ export const TABLETS_RE = {
HisenseTablet: /\b(F5281|E2371)\b/,
Hudl: /Hudl HT7S3|Hudl 2/,
TelstraTablet: /T-Hub2/,
Honeywell: /RT10A/,
GenericTablet: new RegExp(`Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|
A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|
Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b|\\bQTAQZ3\\b|WVT101|TM1088|KT107`),
Expand Down Expand Up @@ -384,6 +385,7 @@ export const DEVICES = {
SIMVALLEY: 'Simvalley',
WOLFGANG: 'Wolfgang',
ALCATEL: 'Alcatel',
HONEYWELL: 'Honeywell',
NINTENDO: 'Nintendo',
AMOI: 'Amoi',
INQ: 'INQ',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,22 @@ describe('DeviceDetectorService', () => {
}
));

it('should detect Device Honeywell RT10A as a tablet', inject(
[DeviceDetectorService],
(service: DeviceDetectorService) => {
const userAgent = 'Mozilla/5.0 (Linux; Android 10; RT10A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Safari/537.36';
service.setDeviceInfo(userAgent);
expect(service.isMobile(userAgent)).toBeFalsy();
expect(service.isDesktop(userAgent)).toBeFalsy();
expect(service.isTablet(userAgent)).toBeTruthy();
const deviceInfo = service.getDeviceInfo();
expect(deviceInfo.device).toBe('Android');
expect(deviceInfo.browser).toBe('Chrome');
expect(deviceInfo.browser_version).toBe('87.0.4280.101');
expect(deviceInfo.deviceType).toBe('tablet');
}
));

/**
* Issues list below
* https://github.com/KoderLabs/ngx-device-detector/issues/191
Expand Down

0 comments on commit 368a76d

Please sign in to comment.