@@ -28,22 +28,22 @@ func Test_ListNotifications(t *testing.T) {
2828 // Setup mock notifications
2929 mockNotifications := []* github.Notification {
3030 {
31- ID : github .String ("1" ),
32- Reason : github .String ("mention" ),
31+ ID : github .Ptr ("1" ),
32+ Reason : github .Ptr ("mention" ),
3333 Subject : & github.NotificationSubject {
34- Title : github .String ("Test Notification 1" ),
34+ Title : github .Ptr ("Test Notification 1" ),
3535 },
3636 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" ),
3838 },
3939 {
40- ID : github .String ("2" ),
41- Reason : github .String ("team_mention" ),
40+ ID : github .Ptr ("2" ),
41+ Reason : github .Ptr ("team_mention" ),
4242 Subject : & github.NotificationSubject {
43- Title : github .String ("Test Notification 2" ),
43+ Title : github .Ptr ("Test Notification 2" ),
4444 },
4545 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" ),
4747 },
4848 }
4949
@@ -112,15 +112,9 @@ func Test_ListNotifications(t *testing.T) {
112112 require .NoError (t , err )
113113 assert .Equal (t , len (tc .expectedResponse ), len (returnedNotifications ))
114114 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 )
122116 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 )
124118 }
125119 })
126120 }
0 commit comments