insertParentWithArchivedChild creates an active parent and an individually-archived child. The returned child reflects its current (archived) state in the DB.
( ctx context.Context, t *testing.T, db database.Store, user database.User, org database.Organization, model database.ChatModelConfig, )
| 1681 | // individually-archived child. The returned child reflects its |
| 1682 | // current (archived) state in the DB. |
| 1683 | func insertParentWithArchivedChild( |
| 1684 | ctx context.Context, |
| 1685 | t *testing.T, |
| 1686 | db database.Store, |
| 1687 | user database.User, |
| 1688 | org database.Organization, |
| 1689 | model database.ChatModelConfig, |
| 1690 | ) (parent database.Chat, child database.Chat) { |
| 1691 | t.Helper() |
| 1692 | parent, child = insertParentWithActiveChild(t, db, user, org, model) |
| 1693 | _, err := db.ArchiveChatByID(ctx, child.ID) |
| 1694 | require.NoError(t, err) |
| 1695 | child, err = db.GetChatByID(ctx, child.ID) |
| 1696 | require.NoError(t, err) |
| 1697 | return parent, child |
| 1698 | } |
| 1699 | |
| 1700 | func TestArchiveChatInterruptsActiveProcessing(t *testing.T) { |
| 1701 | t.Parallel() |
no test coverage detected