Run UI unit tests in CI (#25792)

This commit is contained in:
Luke Parker
2026-05-05 11:05:53 +10:00
committed by GitHub
parent 6b852774e1
commit ca2411d332
4 changed files with 53 additions and 7 deletions

View File

@@ -19,6 +19,21 @@ describe("session diff", () => {
expect(text(view, "additions")).toBe("one\nthree\n")
})
test("keeps missing final newlines from unified patches", () => {
const diff = {
file: "a.ts",
patch:
"Index: a.ts\n===================================================================\n--- a.ts\t\n+++ a.ts\t\n@@ -1,2 +1,2 @@\n one\n-two\n\\ No newline at end of file\n+three\n\\ No newline at end of file\n",
additions: 1,
deletions: 1,
status: "modified" as const,
}
const view = normalize(diff)
expect(text(view, "deletions")).toBe("one\ntwo")
expect(text(view, "additions")).toBe("one\nthree")
})
test("converts legacy content into a patch", () => {
const diff = {
file: "a.ts",