@@ -417,7 +417,6 @@ func (s *ChatTestSuite) TestG_JoinChat_Channel() {
417
417
chatID primitive.ObjectID
418
418
userID string
419
419
Valid bool
420
- Error error
421
420
}{
422
421
{
423
422
chatID : model .NewChatID (),
@@ -439,11 +438,6 @@ func (s *ChatTestSuite) TestG_JoinChat_Channel() {
439
438
for _ , tc := range testCases {
440
439
joinResult , varror := s .service .JoinChat (ctx , tc .chatID , tc .userID )
441
440
if ! tc .Valid {
442
- if tc .Error != nil {
443
- require .Equal (s .T (), tc .Error , varror .Error )
444
- continue
445
- }
446
-
447
441
require .NotNil (s .T (), varror )
448
442
} else if tc .Valid {
449
443
if varror != nil {
@@ -453,6 +447,14 @@ func (s *ChatTestSuite) TestG_JoinChat_Channel() {
453
447
require .Nil (s .T (), varror )
454
448
require .True (s .T (), joinResult .Joined )
455
449
require .NotEmpty (s .T (), joinResult .UpdatedChat )
450
+
451
+ chat , err := s .chatRepo .GetChat (ctx , tc .chatID )
452
+ require .Nil (s .T (), err )
453
+
454
+ chatDetail , err := utils.TypeConverter [model.GroupChatDetail ](chat .ChatDetail )
455
+ require .Nil (s .T (), err )
456
+
457
+ require .True (s .T (), chatDetail .IsMember (tc .userID ))
456
458
} else {
457
459
require .Fail (s .T (), "not specific" )
458
460
}
@@ -484,7 +486,6 @@ func (s *ChatTestSuite) TestH_JoinChat_Group() {
484
486
chatID primitive.ObjectID
485
487
userID string
486
488
Valid bool
487
- Error error
488
489
}{
489
490
{
490
491
chatID : model .NewChatID (),
@@ -506,11 +507,6 @@ func (s *ChatTestSuite) TestH_JoinChat_Group() {
506
507
for _ , tc := range testCases {
507
508
joinResult , varror := s .service .JoinChat (ctx , tc .chatID , tc .userID )
508
509
if ! tc .Valid {
509
- if tc .Error != nil {
510
- require .Equal (s .T (), tc .Error , varror .Error )
511
- continue
512
- }
513
-
514
510
require .NotNil (s .T (), varror )
515
511
} else if tc .Valid {
516
512
if varror != nil {
@@ -520,6 +516,15 @@ func (s *ChatTestSuite) TestH_JoinChat_Group() {
520
516
require .Nil (s .T (), varror )
521
517
require .True (s .T (), joinResult .Joined )
522
518
require .NotEmpty (s .T (), joinResult .UpdatedChat )
519
+
520
+ chat , err := s .chatRepo .GetChat (ctx , tc .chatID )
521
+ require .Nil (s .T (), err )
522
+
523
+ chatDetail , err := utils.TypeConverter [model.GroupChatDetail ](chat .ChatDetail )
524
+ require .Nil (s .T (), err )
525
+
526
+ require .True (s .T (), chatDetail .IsMember (tc .userID ))
527
+
523
528
} else {
524
529
require .Fail (s .T (), "not specific" )
525
530
}
0 commit comments