adventure: show the party, the pets, and what you missed
Four small surfaces the game has had all along and the web has never shown. The party roster on the adventurer page is the one with a bug behind it. The board resolved an expedition by owner id, so a player seated on somebody else's run has been reading as "idle in town" while standing in a tier-4 dungeon. Seats now ride the roster detail beside the supply and threat numbers, and an opted-out player's seat is anonymised rather than dropped: a party of three rendered as a pair contradicts everything printed next to it. Pets show their levelling. They have earned XP from every won fight since that wiring was fixed and the only place a level ever appeared was a Matrix line that scrolled away. The threshold comes from the engine, in the engine's own centi-XP, because a copy of the curve here would drift the first time a band moved. "While you were away" is the one panel on the site about the reader rather than the realm. Two stamps behind it, not one: a single column would show the news, move the clock, and render an empty box over the same events on the reader's first refresh. And the story permalink names its region, which has been hardcoded empty behind a `// reserved` comment since the page shipped.
This commit is contained in:
@@ -551,3 +551,52 @@ func TestUnknownEventTypeStillGuarded(t *testing.T) {
|
||||
t.Error("fact-guard rejection was stored anyway")
|
||||
}
|
||||
}
|
||||
|
||||
// TestPermalinkNamesTheRegion. Region is a fact field, never a story column — the
|
||||
// story is Pete's words and they have no place for a where — so the permalink has
|
||||
// to read it off the fact row it already loads for the run-report link. It was
|
||||
// hardcoded empty with a `// reserved` comment for the whole life of the page.
|
||||
//
|
||||
// The second half matters as much: a multi-region zone is the only place a region
|
||||
// exists, so a dispatch without one must not print an empty separator.
|
||||
func TestPermalinkNamesTheRegion(t *testing.T) {
|
||||
const token = "t"
|
||||
s, _ := newAdvServer(t, token)
|
||||
|
||||
withRegion := AdvFact{
|
||||
GUID: "zone_clear:reg:1000", EventType: "zone_clear", Tier: "bulletin",
|
||||
Actors: []string{"Brannigan"}, Subject: "Brannigan",
|
||||
Zone: "the Underforge", Region: "the Cinder Reach", Level: 14, OccurredAt: 1000,
|
||||
}
|
||||
without := AdvFact{
|
||||
GUID: "zone_clear:noreg:1001", EventType: "zone_clear", Tier: "bulletin",
|
||||
Actors: []string{"Brannigan"}, Subject: "Brannigan",
|
||||
Zone: "the Underforge", Level: 14, OccurredAt: 1001,
|
||||
}
|
||||
for _, f := range []AdvFact{withRegion, without} {
|
||||
if rw := postFact(t, s, token, f); rw.Code != 200 {
|
||||
t.Fatalf("ingest %s = %d", f.GUID, rw.Code)
|
||||
}
|
||||
}
|
||||
|
||||
story := func(guid string) string {
|
||||
req := httptest.NewRequest("GET", "/adventure/"+guid, nil)
|
||||
req.SetPathValue("guid", guid)
|
||||
rw := httptest.NewRecorder()
|
||||
s.handleAdventureStory(rw, req)
|
||||
if rw.Code != 200 {
|
||||
t.Fatalf("permalink %s = %d", guid, rw.Code)
|
||||
}
|
||||
return rw.Body.String()
|
||||
}
|
||||
|
||||
if !strings.Contains(story(withRegion.GUID), "the Cinder Reach") {
|
||||
t.Error("permalink does not name the region the fact carries")
|
||||
}
|
||||
// The template joins the region on with " · "; a regionless dispatch must not
|
||||
// render a dangling one.
|
||||
if body := story(without.GUID); strings.Contains(body, "Reported ") &&
|
||||
strings.Contains(body, " · </p>") {
|
||||
t.Error("a dispatch with no region printed an empty separator")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user