generated from mathias/template-go-web
fix(atlas): UX polish — stage-06 plain nodes + shorter arrow labels (#7)
Stage 06 no longer renders bare in Plain: Build is now tolerant of a jobless/
absent workflow (keeps an authored plain placeholder instead of erroring), and
generated CI job nodes carry a plain hint. Shortened the two overlong transition
labels ("Order written, sealed, agent-ready" → "Sealed & agent-ready",
"Agents produced a change" → "Change proposed") so they stop clipping.
Build tolerance test-first. build/vet/lint(0)/test green; screenshot-verified.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -64,6 +64,20 @@ func TestDefault_HasPlainLayerAndTransitions(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuild_KeepsCIPlaceholderWhenNoJobs(t *testing.T) {
|
||||
atlasJSON := []byte(`{"substrate":[],"stages":[
|
||||
{"no":"STAGE 06","title":"PR → CI","generate":"ci-jobs","nodes":[{"t":"Automated checks","plain":"checks run here"}]}
|
||||
]}`)
|
||||
// A workflow with no jobs block must NOT error and must keep the placeholder.
|
||||
a, err := atlas.Build(atlasJSON, []byte("name: cd\n"))
|
||||
if err != nil {
|
||||
t.Fatalf("Build should tolerate a no-jobs workflow, got: %v", err)
|
||||
}
|
||||
if len(a.Stages[0].Nodes) != 1 || a.Stages[0].Nodes[0].Title != "Automated checks" {
|
||||
t.Fatalf("placeholder not kept: %+v", a.Stages[0].Nodes)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuild_ErrorsOnBadAtlasJSON(t *testing.T) {
|
||||
if _, err := atlas.Build([]byte("{not json"), []byte("jobs:\n x:\n a: 1\n")); err == nil {
|
||||
t.Fatal("expected error on bad atlas JSON, got nil")
|
||||
|
||||
Reference in New Issue
Block a user