mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
Create links to load more lines in diffs
This commit is contained in:
@@ -86,6 +86,19 @@ class DiffResultToDiffResultDtoMapperTest {
|
||||
.isEqualTo("/scm/api/v2/repositories/space/X/diff/123/parsed");
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldCreateLinkToLoadMoreLinesForFilesWithHunks() {
|
||||
DiffResultDto dto = mapper.mapForRevision(REPOSITORY, createResult(), "123");
|
||||
|
||||
assertThat(dto.getFiles().get(0).getLinks().getLinkBy("lines"))
|
||||
.isNotPresent();
|
||||
assertThat(dto.getFiles().get(1).getLinks().getLinkBy("lines"))
|
||||
.isPresent()
|
||||
.get()
|
||||
.extracting("href")
|
||||
.isEqualTo("/scm/api/v2/repositories/space/X/content/123/B.ts?start={start}?end={end}");
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldCreateSelfLinkForIncoming() {
|
||||
DiffResultDto dto = mapper.mapForIncoming(REPOSITORY, createResult(), "feature/some", "master");
|
||||
|
||||
Reference in New Issue
Block a user