Implement option to load rest of files completely

This commit is contained in:
René Pfeuffer
2020-05-30 18:12:03 +02:00
parent b86c025b37
commit 751a2bfa9b
5 changed files with 38 additions and 7 deletions

View File

@@ -199,7 +199,7 @@ describe("with hunks the diff expander", () => {
});
it("should return a really bix number for the expand bottom range of the last hunk", () => {
expect(diffExpander.getHunk(3).maxExpandBottomRange).toBeGreaterThan(99999);
expect(diffExpander.getHunk(3).maxExpandBottomRange).toBe(-1);
});
it("should expand hunk with new line from api client at the bottom", async () => {
expect(diffExpander.getHunk(1).hunk.changes.length).toBe(7);
@@ -251,6 +251,18 @@ describe("with hunks the diff expander", () => {
await fetchMock.flush(true);
expect(newFile.hunks[3].fullyExpanded).toBe(true);
});
it("should set end to -1 if requested to expand to the end", async () => {
fetchMock.get(
"http://localhost:8081/scm/api/v2/content/abc/CommitMessage.js?start=40&end=-1",
"new line 40\nnew line 41\nnew line 42"
);
let newFile;
diffExpander.getHunk(3).expandBottom(-1, file => {
newFile = file;
});
await fetchMock.flush(true);
expect(newFile.hunks[3].fullyExpanded).toBe(true);
});
});
describe("for a new file with text input the diff expander", () => {