@@ -21,6 +21,7 @@ func TestFullAndIncrementalBuild(t *testing.T) { |
| 21 |
runGit(t, dir, "config", "user.email", "[email protected]") |
21 |
runGit(t, dir, "config", "user.email", "[email protected]") |
| 22 |
write(t, dir, "README.md", "# Hello bucket\n") |
22 |
write(t, dir, "README.md", "# Hello bucket\n") |
| 23 |
write(t, dir, "LICENSE", "test license\n") |
23 |
write(t, dir, "LICENSE", "test license\n") |
|
|
24 |
write(t, dir, "payload.bin", "binary\x00payload\n") |
| 24 |
write(t, dir, "danger.html", "<!doctype html><script>alert('nope')</script>\n") |
25 |
write(t, dir, "danger.html", "<!doctype html><script>alert('nope')</script>\n") |
| 25 |
write(t, dir, "docs/guide.md", "# Guide\n\n- first\n- second\n") |
26 |
write(t, dir, "docs/guide.md", "# Guide\n\n- first\n- second\n") |
| 26 |
write(t, dir, "src/main.go", "package main\n\nfunc main() {}\n") |
27 |
write(t, dir, "src/main.go", "package main\n\nfunc main() {}\n") |
@@ -46,6 +47,9 @@ func TestFullAndIncrementalBuild(t *testing.T) { |
| 46 |
assertPage(t, full, "", "data-branch-menu") |
47 |
assertPage(t, full, "", "data-branch-menu") |
| 47 |
assertPage(t, full, "", "data-copied-icon") |
48 |
assertPage(t, full, "", "data-copied-icon") |
| 48 |
assertPage(t, full, "", ".dumbforge/assets/gabriel-mark.svg") |
49 |
assertPage(t, full, "", ".dumbforge/assets/gabriel-mark.svg") |
|
|
50 |
assertPage(t, full, "", `.dumbforge/assets/site.css?v=`+generator.AssetVersion()) |
|
|
51 |
assertPage(t, full, ".dumbforge/assets/site.css", "@media (prefers-color-scheme: light)") |
|
|
52 |
assertPage(t, full, ".dumbforge/assets/site.css", ".commit-list-message { overflow: hidden; color: var(--text);") |
| 49 |
assertPage(t, full, "", `<span class="header-owner">owner</span><span>/</span>`) |
53 |
assertPage(t, full, "", `<span class="header-owner">owner</span><span>/</span>`) |
| 50 |
assertPageDoesNotContain(t, full, "", `href="https://example.invalid/repo.git">owner</a>`) |
54 |
assertPageDoesNotContain(t, full, "", `href="https://example.invalid/repo.git">owner</a>`) |
| 51 |
assertPage(t, full, "", "Languages") |
55 |
assertPage(t, full, "", "Languages") |
@@ -79,6 +83,7 @@ func TestFullAndIncrementalBuild(t *testing.T) { |
| 79 |
assertPage(t, full, "commit/"+first, `aria-label="Side-by-side diff for README.md"`) |
83 |
assertPage(t, full, "commit/"+first, `aria-label="Side-by-side diff for README.md"`) |
| 80 |
assertPage(t, full, "commit/"+first, `class="diff-code new addition`) |
84 |
assertPage(t, full, "commit/"+first, `class="diff-code new addition`) |
| 81 |
assertPage(t, full, "commit/"+first, "A longer explanation of the initial change.") |
85 |
assertPage(t, full, "commit/"+first, "A longer explanation of the initial change.") |
|
|
86 |
assertPageDoesNotContain(t, full, "commit/"+first, "payload.bin") |
| 82 |
assertPage(t, full, ".dumbforge/files/main.json", `"path":"src/main.go"`) |
87 |
assertPage(t, full, ".dumbforge/files/main.json", `"path":"src/main.go"`) |
| 83 |
assertPageDoesNotContain(t, full, "", "Search this repository") |
88 |
assertPageDoesNotContain(t, full, "", "Search this repository") |
| 84 |
assertPageDoesNotContain(t, full, "", ">Docs<") |
89 |
assertPageDoesNotContain(t, full, "", ">Docs<") |
@@ -107,7 +112,8 @@ func TestFullAndIncrementalBuild(t *testing.T) { |
| 107 |
assertPage(t, incremental, "", `commit/`+first+`" title="initial">initial</a>`) |
112 |
assertPage(t, incremental, "", `commit/`+first+`" title="initial">initial</a>`) |
| 108 |
assertPage(t, incremental, "commits/main", "change one file") |
113 |
assertPage(t, incremental, "commits/main", "change one file") |
| 109 |
assertPage(t, incremental, "commit/"+second, `class="diff-code old deletion`) |
114 |
assertPage(t, incremental, "commit/"+second, `class="diff-code old deletion`) |
| 110 |
assertPage(t, incremental, "commit/"+second, `println("changed")`) |
115 |
assertPage(t, incremental, "commit/"+second, `class="diff-kd"`) |
|
|
116 |
assertPage(t, incremental, "commit/"+second, `changed`) |
| 111 |
assertPage(t, incremental, "commit/"+second, `parent <a href="https://example.invalid/repo.git/commit/`+first+`"><code>`) |
117 |
assertPage(t, incremental, "commit/"+second, `parent <a href="https://example.invalid/repo.git/commit/`+first+`"><code>`) |
| 112 |
assertNoPage(t, incremental, "commit/"+first) |
118 |
assertNoPage(t, incremental, "commit/"+first) |
| 113 |
|
119 |
|