mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-10-26 22:37:03 +00:00
test(server): drop the unreadable-collection item-context test, vacuous since the brief reuses the dashboard's predicates (PLAN-3598 slice (b))
It pinned a decision the brief's own lifecycle cache made (an undecodable
schema is open work, not reference). b350f7f09 deleted that cache: the
brief now asks isItemDone and isReferenceCollection, which never consult
whether the schema decoded (reference-ness reads settings; a zero schema
compares status against the default terminal values), so no change to the
brief could make it fail. It also failed on Postgres in setup: the json
schema column refuses the non-JSON string it wrote (22P02).
Claude-Session: https://claude.ai/code/session_01Q9WssCjFuHjSfLABoW4tmS
This commit is contained in:
@@ -360,42 +360,3 @@ func TestPLAN3598_ItemContextReferenceBlockerAgreesWithDashboard(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// A blocker whose collection's schema cannot be read still raises
|
||||
// open_blocker: isItemDone, the dashboard's predicate, reads an unparseable
|
||||
// schema as zero-valued, so an open status stays open.
|
||||
func TestPLAN3598_ItemContextUnreadableCollectionStaysOpenWork(t *testing.T) {
|
||||
forEachDialect(t, func(t *testing.T, d store.DriverType) {
|
||||
f := newCtxFixture(t, d)
|
||||
coll, err := f.srv.store.CreateCollection(f.wsID, models.CollectionCreate{
|
||||
Name: "Oddities",
|
||||
Schema: `{"fields":[{"key":"status","label":"Status","type":"select","options":["open","done"],"terminal_options":["done"]}]}`,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
odd, err := f.srv.store.CreateItem(f.wsID, coll.ID, models.ItemCreate{Title: "Ctx odd blocker", Fields: `{"status":"open"}`})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := f.srv.store.CreateItemLink(f.wsID, models.ItemLinkCreate{TargetID: f.task.ID, LinkType: models.ItemLinkTypeBlocks}, odd.ID); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if _, err := f.srv.store.DB().Exec(f.srv.store.D().Rebind(`UPDATE collections SET schema = ? WHERE id = ?`), "not json", coll.ID); err != nil {
|
||||
t.Fatalf("corrupt schema: %v", err)
|
||||
}
|
||||
resp, code, body := f.context(f.ownerTok, "?intent=implement")
|
||||
if resp == nil {
|
||||
t.Fatalf("status %d: %s", code, body)
|
||||
}
|
||||
found := false
|
||||
for _, c := range resp.Conflicts {
|
||||
for _, r := range c.Refs {
|
||||
found = found || (c.Kind == "open_blocker" && r == odd.Ref)
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Errorf("a blocker in an unreadable collection should stay open work: %+v", resp.Conflicts)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user