1# A person's avatar is drawn from their name: the same name gives the same2# art every time and at every size (on their page and on the home page's3# profiles), and two names give two different ones. It is SVG in the4# avatar tokens' classes, no colours of its own.5. "$(dirname "$0")/../lib.sh"6user dami7user ana8for r in dami/chess ana/notes; do9 repo "$r"10 clone "${r%%/*}" "$r" "$T/w/${r#*/}"11 at "$T/w/${r#*/}" commit "first"12 push_as "${r%%/*}" "$T/w/${r#*/}" origin main13done14a=$(node "$T_HOME/lib/avatar.ts" dami 72)15eq "$(node "$T_HOME/lib/avatar.ts" dami 72)" "$a"16b=$(node "$T_HOME/lib/avatar.ts" ana 72)17[ "$a" != "$b" ] || fail "dami and ana have the same avatar"18case $a in '<svg class="avatar" viewBox="0 0 72 72" width="72" height="72" aria-hidden="true"><rect class="av-g" width="72" height="72"/>'*) ;; *) fail "not an avatar: $a" ;; esac19printf '%s' "$a" | grep -q '#' && fail "an avatar names a colour: $a"20export FORGE_STRICT=121build22# The same drawing on dami's page (72px) and the home page (36px).23art=$(printf '%s' "$a" | sed 's|^<svg[^>]*>||')24grep -qF "$art" "$FORGE_WWW/dami/index.html" || fail "dami's page draws dami differently"25grep -qF "$art" "$FORGE_WWW/index.html" || fail "the home page draws dami differently"26has "$FORGE_WWW/index.html" '<li class="profile"><svg class="avatar" viewBox="0 0 72 72" width="36" height="36" aria-hidden="true">'27has "$FORGE_WWW/dami/index.html" '<section class="person">'