package e2e import ( "os" "path/filepath" "strings" "testing" ) // Markdown and org files render on the blob page, with the source one // click away; everything else is unchanged. func TestBlobRendersMarkup(t *testing.T) { t.Parallel() inst := startInstance(t) aliceKey := inst.newKey(t, "alice") inst.admin(t, "admin", "user", "create", "alice", "--key", aliceKey+".pub") if _, _, code := inst.ssh(t, aliceKey, "", "repo", "create", "alice/docs"); code != 0 { t.Fatal("repo create failed") } work := t.TempDir() env := inst.gitEnv(aliceKey) mustGit(t, work, env, "clone", inst.sshURL("alice/docs"), "w") dir := filepath.Join(work, "w") os.MkdirAll(filepath.Join(dir, "docs"), 0o755) os.WriteFile(filepath.Join(dir, "docs", "notes.md"), []byte("# Field notes\n\nSee [the plan](plan.org).\n"), 0o644) os.WriteFile(filepath.Join(dir, "docs", "plan.org"), []byte("* The plan\n\nA *bold* claim.\n"), 0o644) os.WriteFile(filepath.Join(dir, "main.go"), []byte("package main\n"), 0o644) mustGit(t, dir, env, "checkout", "-q", "-b", "main") mustGit(t, dir, env, "add", ".") mustGit(t, dir, env, "commit", "-q", "-m", "docs") mustGit(t, dir, env, "push", "-q", "origin", "main") status, body := inst.get(t, "/alice/docs/blob/main/docs/notes.md") if status != 200 || !strings.Contains(body, `