Skip to content

Commit 70c5b5f

Browse files
committed
fix unit test
1 parent 1e75e34 commit 70c5b5f

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

internal/domain/message_history_test.go

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -690,14 +690,22 @@ func TestMessageListParams_FromQuery(t *testing.T) {
690690
queryData: map[string][]string{
691691
"broadcast_id": {"not-a-uuid"}, // Not a UUID format
692692
},
693-
wantErr: true,
693+
want: MessageListParams{
694+
BroadcastID: "not-a-uuid",
695+
Limit: 20, // Default limit
696+
},
697+
wantErr: false,
694698
},
695699
{
696700
name: "with invalid template_id",
697701
queryData: map[string][]string{
698702
"template_id": {"not-a-uuid"}, // Not a UUID format
699703
},
700-
wantErr: true,
704+
want: MessageListParams{
705+
TemplateID: "not-a-uuid",
706+
Limit: 20, // Default limit
707+
},
708+
wantErr: false,
701709
},
702710
{
703711
name: "with invalid time range (sent)",
@@ -977,14 +985,22 @@ func TestMessageListParams_Validate(t *testing.T) {
977985
params: MessageListParams{
978986
BroadcastID: "not-a-uuid",
979987
},
980-
wantErr: true,
988+
want: MessageListParams{
989+
BroadcastID: "not-a-uuid",
990+
Limit: 20, // Default limit
991+
},
992+
wantErr: false,
981993
},
982994
{
983995
name: "invalid template ID",
984996
params: MessageListParams{
985997
TemplateID: "not-a-uuid",
986998
},
987-
wantErr: true,
999+
want: MessageListParams{
1000+
TemplateID: "not-a-uuid",
1001+
Limit: 20, // Default limit
1002+
},
1003+
wantErr: false,
9881004
},
9891005
{
9901006
name: "valid time ranges",

0 commit comments

Comments
 (0)