Skip to content

Commit 3bc5987

Browse files
authored
Merge pull request #478 from gemini-testing/sp.changeBaseHost.INFRADUTY-25002
fix(host-input): broken test links on host change
2 parents fa31f5c + b34dfed commit 3bc5987

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

lib/common-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ exports.isUrl = (str) => {
6363
return parsedUrl.host && parsedUrl.protocol;
6464
};
6565

66-
exports.buildUrl = (href, host) => {
66+
exports.buildUrl = (href, {host} = {}) => {
6767
return host
6868
? url.format(Object.assign(url.parse(href), {host}))
6969
: href;

lib/static/components/section/title/browser.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class BrowserTitle extends Component {
2020
// from store
2121
testName: PropTypes.string.isRequired,
2222
retryIndex: PropTypes.number.isRequired,
23-
suiteUrl: PropTypes.string,
24-
parsedHost: PropTypes.object
23+
suiteUrl: PropTypes.string
2524
}
2625

2726
_getTestUrl() {

test/unit/lib/common-utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ describe('common-utils', () => {
106106

107107
it('should return url with specified host if it is provided', () => {
108108
const href = 'https://oldhost.com/path';
109-
const host = 'newhost.com';
109+
const parsedHost = {host: 'newhost.com'};
110110

111-
const url = buildUrl(href, host);
111+
const url = buildUrl(href, parsedHost);
112112

113113
assert.equal(url, 'https://newhost.com/path');
114114
});

0 commit comments

Comments
 (0)