( ctx context.Context, t *testing.T, client *codersdk.ExperimentalClient, organizationID uuid.UUID, text string, fileIDs ...uuid.UUID, )
| 465 | } |
| 466 | |
| 467 | func createChatForSharing( |
| 468 | ctx context.Context, |
| 469 | t *testing.T, |
| 470 | client *codersdk.ExperimentalClient, |
| 471 | organizationID uuid.UUID, |
| 472 | text string, |
| 473 | fileIDs ...uuid.UUID, |
| 474 | ) codersdk.Chat { |
| 475 | t.Helper() |
| 476 | |
| 477 | content := []codersdk.ChatInputPart{{ |
| 478 | Type: codersdk.ChatInputPartTypeText, |
| 479 | Text: text, |
| 480 | }} |
| 481 | for _, fileID := range fileIDs { |
| 482 | content = append(content, codersdk.ChatInputPart{ |
| 483 | Type: codersdk.ChatInputPartTypeFile, |
| 484 | FileID: fileID, |
| 485 | }) |
| 486 | } |
| 487 | chat, err := client.CreateChat(ctx, codersdk.CreateChatRequest{ |
| 488 | OrganizationID: organizationID, |
| 489 | Content: content, |
| 490 | }) |
| 491 | require.NoError(t, err) |
| 492 | return chat |
| 493 | } |
| 494 | |
| 495 | func chatUserRoles(users []codersdk.ChatUser) map[uuid.UUID]codersdk.ChatRole { |
| 496 | roles := make(map[uuid.UUID]codersdk.ChatRole, len(users)) |
no test coverage detected