Skip to content
quarry Artifact [2cc37f2a65]
Login

Artifact [2cc37f2a65]

Artifact 2cc37f2a65a1c272c612dd2075f5fbe1de755e45e4403c3be8be08df80a4f15f:


package web

import (
	"os"
	"path/filepath"
	"strings"
	"testing"
)

// A LOOKING aid for the two onboarding surfaces. Off unless set.
func TestWriteAboutShot(t *testing.T) {
	out := os.Getenv("QUARRY_SHOT_ABOUT")
	if out == "" {
		t.Skip("QUARRY_SHOT_ABOUT unset")
	}
	if err := os.WriteFile(filepath.Join(filepath.Dir(out), "quarry.css"),
		[]byte(sheet), 0o644); err != nil {
		t.Fatal(err)
	}
	data := pageData{Title: "About", SheetURL: "quarry.css", Origin: "https://zeitforge.app",
		InviteOnly: true}
	var b strings.Builder
	if err := aboutPage.Execute(&b, data); err != nil {
		t.Fatal(err)
	}
	if err := os.WriteFile(out, []byte(b.String()), 0o644); err != nil {
		t.Fatal(err)
	}
	home := pageData{Title: "Home", SheetURL: "quarry.css",
		InviteOnly: true,
		Fleet:      []repoInfo{{Name: "quarry", Description: "a forge front-end for zit", Checkins: 1642}},
		FleetTotal: 1, Served: 1}
	var h strings.Builder
	if err := explorePage.Execute(&h, home); err != nil {
		t.Fatal(err)
	}
	os.WriteFile(filepath.Join(filepath.Dir(out), "home.html"), []byte(h.String()), 0o644)
}