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

Function TestService_DeleteByChatID

coderd/x/chatd/chatdebug/service_test.go:570–595  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

568}
569
570func TestService_DeleteByChatID(t *testing.T) {
571 t.Parallel()
572
573 fixture := newFixture(t)
574 run := createRun(t, fixture)
575 _, err := fixture.svc.CreateStep(fixture.ctx, chatdebug.CreateStepParams{
576 RunID: run.ID,
577 ChatID: fixture.chat.ID,
578 StepNumber: 1,
579 Operation: chatdebug.OperationGenerate,
580 Status: chatdebug.StatusInProgress,
581 })
582 require.NoError(t, err)
583
584 deleted, err := fixture.svc.DeleteByChatID(fixture.ctx, fixture.chat.ID,
585 time.Now().Add(time.Minute))
586 require.NoError(t, err)
587 require.EqualValues(t, 1, deleted)
588
589 runs, err := fixture.db.GetChatDebugRunsByChatID(fixture.ctx, database.GetChatDebugRunsByChatIDParams{
590 ChatID: fixture.chat.ID,
591 LimitVal: 100,
592 })
593 require.NoError(t, err)
594 require.Empty(t, runs)
595}
596
597func TestService_DeleteAfterMessageID(t *testing.T) {
598 t.Parallel()

Callers

nothing calls this directly

Calls 7

newFixtureFunction · 0.85
createRunFunction · 0.85
CreateStepMethod · 0.80
DeleteByChatIDMethod · 0.80
AddMethod · 0.65
EmptyMethod · 0.45

Tested by

no test coverage detected