@@ -28,22 +28,22 @@ func Test_ListNotifications(t *testing.T) {
28
28
// Setup mock notifications
29
29
mockNotifications := []* github.Notification {
30
30
{
31
- ID : github .String ("1" ),
32
- Reason : github .String ("mention" ),
31
+ ID : github .Ptr ("1" ),
32
+ Reason : github .Ptr ("mention" ),
33
33
Subject : & github.NotificationSubject {
34
- Title : github .String ("Test Notification 1" ),
34
+ Title : github .Ptr ("Test Notification 1" ),
35
35
},
36
36
UpdatedAt : & github.Timestamp {Time : time .Now ()},
37
- URL : github .String ("https://example.com/notifications/threads/1" ),
37
+ URL : github .Ptr ("https://example.com/notifications/threads/1" ),
38
38
},
39
39
{
40
- ID : github .String ("2" ),
41
- Reason : github .String ("team_mention" ),
40
+ ID : github .Ptr ("2" ),
41
+ Reason : github .Ptr ("team_mention" ),
42
42
Subject : & github.NotificationSubject {
43
- Title : github .String ("Test Notification 2" ),
43
+ Title : github .Ptr ("Test Notification 2" ),
44
44
},
45
45
UpdatedAt : & github.Timestamp {Time : time .Now ()},
46
- URL : github .String ("https://example.com/notifications/threads/1" ),
46
+ URL : github .Ptr ("https://example.com/notifications/threads/1" ),
47
47
},
48
48
}
49
49
@@ -112,15 +112,9 @@ func Test_ListNotifications(t *testing.T) {
112
112
require .NoError (t , err )
113
113
assert .Equal (t , len (tc .expectedResponse ), len (returnedNotifications ))
114
114
for i , notification := range returnedNotifications {
115
- // Ensure all required fields are mocked
116
- assert .NotNil (t , notification .Subject , "Subject should not be nil" )
117
- assert .NotNil (t , notification .Subject .Title , "Title should not be nil" )
118
- assert .NotNil (t , notification .Reason , "Reason should not be nil" )
119
- assert .NotNil (t , notification .URL , "URL should not be nil" )
120
- assert .NotNil (t , notification .UpdatedAt , "UpdatedAt should not be nil" )
121
- // assert.Equal(t, *tc.expectedResponse[i].ID, *notification.ID)
115
+ assert .Equal (t , * tc .expectedResponse [i ].ID , * notification .ID )
122
116
assert .Equal (t , * tc .expectedResponse [i ].Reason , * notification .Reason )
123
- // assert.Equal(t, *tc.expectedResponse[i].Subject.Title, *notification.Subject.Title)
117
+ assert .Equal (t , * tc .expectedResponse [i ].Subject .Title , * notification .Subject .Title )
124
118
}
125
119
})
126
120
}
0 commit comments