@@ -215,7 +215,10 @@ func TestWebhookShow(t *testing.T) {
215215 if ! result .Response .OK {
216216 t .Error ("expected success response" )
217217 }
218- if got := mock .GetWithPaginationCalls [0 ].Path ; got != "/boards/board-1/webhooks/wh-1" {
218+ if len (mock .GetCalls ) != 1 {
219+ t .Fatalf ("expected 1 GET call, got %d" , len (mock .GetCalls ))
220+ }
221+ if got := mock .GetCalls [0 ].Path ; got != "/boards/board-1/webhooks/wh-1" {
219222 t .Errorf ("expected path '/boards/board-1/webhooks/wh-1', got '%s'" , got )
220223 }
221224 })
@@ -241,6 +244,7 @@ func TestWebhookCreate(t *testing.T) {
241244 mock := NewMockClient ()
242245 mock .PostResponse = & client.APIResponse {
243246 StatusCode : 201 ,
247+ Location : "/boards/board-1/webhooks/wh-new" ,
244248 Data : map [string ]any {
245249 "id" : "wh-new" ,
246250 "name" : "My Hook" ,
@@ -276,6 +280,9 @@ func TestWebhookCreate(t *testing.T) {
276280 if body ["url" ] != "https://example.com/hook" {
277281 t .Errorf ("expected url 'https://example.com/hook', got '%v'" , body ["url" ])
278282 }
283+ if got := result .Response .Context ["location" ]; got != "/boards/board-1/webhooks/wh-new" {
284+ t .Errorf ("expected location context, got %v" , got )
285+ }
279286 })
280287
281288 t .Run ("creates webhook with actions" , func (t * testing.T ) {
@@ -472,7 +479,7 @@ func TestWebhookReactivate(t *testing.T) {
472479 },
473480 }
474481
475- SetTestModeWithSDK (mock )
482+ result := SetTestModeWithSDK (mock )
476483 SetTestConfig ("token" , "account" , "https://api.example.com" )
477484 defer resetTest ()
478485
@@ -484,6 +491,13 @@ func TestWebhookReactivate(t *testing.T) {
484491 if mock .PostCalls [0 ].Path != "/boards/board-1/webhooks/wh-1/activation.json" {
485492 t .Errorf ("expected path '/boards/board-1/webhooks/wh-1/activation.json', got '%s'" , mock .PostCalls [0 ].Path )
486493 }
494+ data , ok := result .Response .Data .(map [string ]any )
495+ if ! ok {
496+ t .Fatalf ("expected response data map, got %T" , result .Response .Data )
497+ }
498+ if data ["id" ] != "wh-1" || data ["active" ] != true {
499+ t .Fatalf ("expected activated webhook data, got %#v" , data )
500+ }
487501 })
488502
489503 t .Run ("requires board" , func (t * testing.T ) {
0 commit comments