mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2026-01-02 20:34:41 +03:00
[test] Add tests for the new submodules
This commit is contained in:
13
test/unit/submodules/helpers.spec.js
Normal file
13
test/unit/submodules/helpers.spec.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const assert = require('assert');
|
||||
const { isFrozenUA } = require('../../../src/helpers/ua-parser-helpers');
|
||||
|
||||
describe('isFrozenUA()', () => {
|
||||
it('matches supplied user-agent string with known frozen user-agent pattern', () => {
|
||||
|
||||
const regularMobileUA = "Mozilla/5.0 (Linux; Android 9; SM-A205U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.1234.56 Mobile Safari/537.36";
|
||||
const frozenMobileUA = "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.0.0 Mobile Safari/537.36";
|
||||
|
||||
assert.equal(isFrozenUA(regularMobileUA), false);
|
||||
assert.equal(isFrozenUA(frozenMobileUA), true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user