Skip to content
quarry Artifact [1b6674cf35]
Login

Artifact [1b6674cf35]

Artifact 1b6674cf35b25b451c6302edda289e84e4c6408a89bde7630e6439b2e5362e54:


package web

import (
	"strings"
	"testing"
)

// The diagram's sizing rules reach the diagram only. Written against
// .pikchr-fig svg, they also caught the bar's icons, and each Copy and
// studio icon was drawn as wide as the diagram.
func TestDiagramSizingSkipsTheBarsIcons(t *testing.T) {
	for _, bad := range []string{".pikchr-fig svg {", ".pikchr-fig:target svg {"} {
		if strings.Contains(sheet, bad) {
			t.Errorf("FAIL: %q sizes every svg in the frame, the bar's icons included", bad)
		}
	}
	if !strings.Contains(sheet, ".pikchr-view svg {") {
		t.Error("FAIL: the diagram lost its sizing rule")
	}
	t.Log("ok: sizing is scoped to the diagram")
}