MCPcopy Index your code
hub / github.com/coder/coder / insertParentWithActiveChild

Function insertParentWithActiveChild

coderd/x/chatd/chatd_test.go:1655–1678  ·  view source on GitHub ↗

insertParentWithActiveChild creates a parent chat and an active child chat linked to it. Both are returned in their initial (active) state.

(
	t *testing.T,
	db database.Store,
	user database.User,
	org database.Organization,
	model database.ChatModelConfig,
)

Source from the content-addressed store, hash-verified

1653// child chat linked to it. Both are returned in their initial
1654// (active) state.
1655func insertParentWithActiveChild(
1656 t *testing.T,
1657 db database.Store,
1658 user database.User,
1659 org database.Organization,
1660 model database.ChatModelConfig,
1661) (parent database.Chat, child database.Chat) {
1662 t.Helper()
1663 parent = dbgen.Chat(t, db, database.Chat{
1664 OrganizationID: org.ID,
1665 OwnerID: user.ID,
1666 LastModelConfigID: model.ID,
1667 Title: "parent",
1668 })
1669 child = dbgen.Chat(t, db, database.Chat{
1670 OrganizationID: org.ID,
1671 OwnerID: user.ID,
1672 LastModelConfigID: model.ID,
1673 Title: "child",
1674 ParentChatID: uuid.NullUUID{UUID: parent.ID, Valid: true},
1675 RootChatID: uuid.NullUUID{UUID: parent.ID, Valid: true},
1676 })
1677 return parent, child
1678}
1679
1680// insertParentWithArchivedChild creates an active parent and an
1681// individually-archived child. The returned child reflects its

Callers 2

TestUnarchiveChildChatFunction · 0.85

Calls 2

ChatFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected