Skip to content

Commit

Permalink
update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
fippo committed Mar 8, 2024
1 parent 4973efe commit 2989d73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/unit/detectBrowser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ describe('detectBrowser', () => {
expect(browserDetails.version).toEqual(95);
});

it('detects Chrome if navigator.userAgentData exist', () => {
it('detects Chrome if navigator.userAgentData exists', () => {
navigator.userAgentData = {brands: [{brand: 'Chromium', version: 102}]};
// Use the wrong UA string for Firefox.
navigator.userAgent = 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; ' +
'rv:44.0) Gecko/20100101 Firefox/44.0';
navigator.mozGetUserMedia = function() {};

const browserDetails = detectBrowser(window);
expect(browserDetails.browser).to.equal('chrome');
expect(browserDetails.version).to.equal(102);
expect(browserDetails.browser).toEqual('chrome');
expect(browserDetails.version).toEqual(102);
});

it('detects Safari if window.RTCPeerConnection exists', () => {
Expand Down

0 comments on commit 2989d73

Please sign in to comment.