Skip to content

Commit f2d15b6

Browse files
jsnellbakermkendall07
authored andcommitted
change utils.js unit tests to fix browserstack errors (#2337)
* alter utils unit tests * added comment to clarify the change
1 parent b633478 commit f2d15b6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/spec/utils_spec.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { getAdServerTargeting } from 'test/fixtures/fixtures';
2+
import { expect } from 'chai';
23

34
var assert = require('assert');
45
var utils = require('src/utils');
@@ -720,10 +721,11 @@ describe('Utils', function () {
720721
expect(topWindowLocation.href).to.equal('https://www.google.com/a/umich.edu/acs');
721722
expect(topWindowLocation.protocol).to.equal('https');
722723
expect(topWindowLocation.hostname).to.equal('www.google.com');
723-
expect(topWindowLocation.port).to.equal(0);
724724
expect(topWindowLocation.hash).to.equal('');
725725
expect(topWindowLocation.search).to.equal('');
726-
expect(topWindowLocation.host).to.equal('www.google.com');
726+
// note IE11 returns the default secure port, so we look for this alternate value as well in these tests
727+
expect(topWindowLocation.port).to.be.oneOf([0, 443]);
728+
expect(topWindowLocation.host).to.be.oneOf(['www.google.com', 'www.google.com:443']);
727729
});
728730

729731
it('returns parsed referrer string if in iFrame but no ancestorOrigins', () => {
@@ -740,11 +742,12 @@ describe('Utils', function () {
740742
expect(topWindowLocation.href).to.equal('https://www.example.com/');
741743
expect(topWindowLocation.protocol).to.equal('https');
742744
expect(topWindowLocation.hostname).to.equal('www.example.com');
743-
expect(topWindowLocation.port).to.equal(0);
744745
expect(topWindowLocation.pathname).to.equal('/');
745746
expect(topWindowLocation.hash).to.equal('');
746747
expect(topWindowLocation.search).to.equal('');
747-
expect(topWindowLocation.host).to.equal('www.example.com');
748+
// note IE11 returns the default secure port, so we look for this alternate value as well in these tests
749+
expect(topWindowLocation.port).to.be.oneOf([0, 443]);
750+
expect(topWindowLocation.host).to.be.oneOf(['www.example.com', 'www.example.com:443']);
748751
});
749752
});
750753
});

0 commit comments

Comments
 (0)