Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gui): wrong base url for tests in gui mode #598

Merged
merged 1 commit into from
Sep 13, 2024
Merged

Conversation

sipayRT
Copy link
Member

@sipayRT sipayRT commented Sep 6, 2024

No description provided.

@@ -72,21 +72,23 @@ export const determineFinalStatus = (statuses: TestStatus[]): TestStatus | null

export const getUrlWithBase = (url: string | undefined, base: string | undefined): string => {
try {
if (isEmpty(base)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like that we can write this code outside try statement, because i don't see what can trigger an error in this code.

@@ -41,7 +41,7 @@ class ViewInBrowser extends Component {
return (
<a
className={className}
href={getUrlWithBase(getRelativeUrl(suiteUrl), baseHost)}
href={getUrlWithBase(suiteUrl, baseHost)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was the problem with using getRelativeUrl method?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case of empty baseHost relative path will be returned:

getUrlWithBase(getRelativeUrl("https://ya.ru/some/path"), null); ==> /some/path

and such relative paths will be resolved in the browser relative to the report host

@sipayRT sipayRT force-pushed the sp.fixAbsUrlGui branch 2 times, most recently from c2e7861 to f397923 Compare September 13, 2024 13:26
@sipayRT sipayRT merged commit 090649f into master Sep 13, 2024
4 checks passed
@sipayRT sipayRT deleted the sp.fixAbsUrlGui branch September 13, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants