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

Function TestService_IsEnabled_AlwaysEnable

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

Source from the content-addressed store, hash-verified

73}
74
75func TestService_IsEnabled_AlwaysEnable(t *testing.T) {
76 t.Parallel()
77
78 ctx := testutil.Context(t, testutil.WaitLong)
79 db, _, _ := dbtestutil.NewDBWithSQLDB(t)
80 _, owner, chat, model := seedChat(t, db)
81 require.NotEqual(t, uuid.Nil, model.ID)
82
83 svc := chatdebug.NewService(db, testutil.Logger(t), nil, chatdebug.WithAlwaysEnable(true))
84 require.True(t, svc.IsEnabled(ctx, chat.ID, owner.ID))
85 require.True(t, svc.IsEnabled(ctx, chat.ID, uuid.Nil))
86}
87
88func TestService_IsEnabled_ZeroValueService(t *testing.T) {
89 t.Parallel()

Callers

nothing calls this directly

Calls 7

IsEnabledMethod · 0.95
ContextFunction · 0.92
NewDBWithSQLDBFunction · 0.92
NewServiceFunction · 0.92
LoggerFunction · 0.92
WithAlwaysEnableFunction · 0.92
seedChatFunction · 0.85

Tested by

no test coverage detected