Skip to content

Commit

Permalink
Merge pull request #255 from qtzar/bugfix_dropdownlinks
Browse files Browse the repository at this point in the history
Bugfix : Add final forward slash to the href in the branches dropdown
  • Loading branch information
dirkgroot authored Jul 6, 2023
2 parents 43bc0f6 + 6c634a7 commit 0fde981
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ data class BranchHomeLinkViewModel(
private val branchName: String
) {
val title get() = branchName
val relativeHref get() = HomePageViewModel.url().asUrlToDirectory(pageViewModel.url) + "../$branchName"
val relativeHref get() = HomePageViewModel.url().asUrlToDirectory(pageViewModel.url) + "../$branchName/"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ class BranchHomeLinkViewModelTest : ViewModelTest() {
val viewModel = BranchHomeLinkViewModel(pageViewModel("/master/decisions/1"), "branch-1")

assertThat(viewModel.relativeHref)
.isEqualTo("../../../../branch-1")
.isEqualTo("../../../../branch-1/")
}

@Test
fun `relative href from home`() {
val viewModel = BranchHomeLinkViewModel(pageViewModel("/"), "master")

assertThat(viewModel.relativeHref)
.isEqualTo("./../master")
.isEqualTo("./../master/")
}
}

0 comments on commit 0fde981

Please sign in to comment.