@@ -10,7 +10,13 @@ import (
1010func TestIdentityTimezoneUpdate (t * testing.T ) {
1111 t .Run ("updates timezone" , func (t * testing.T ) {
1212 mock := NewMockClient ()
13- mock .PatchResponse = & client.APIResponse {StatusCode : 204 , Data : nil }
13+ mock .PatchResponse = & client.APIResponse {
14+ StatusCode : 200 ,
15+ Data : map [string ]any {
16+ "timezone_name" : "America/New_York" ,
17+ "updated_at" : "2026-06-03T21:15:00Z" ,
18+ },
19+ }
1420
1521 result := SetTestModeWithSDK (mock )
1622 SetTestConfig ("token" , "account" , "https://api.example.com" )
@@ -42,6 +48,29 @@ func TestIdentityTimezoneUpdate(t *testing.T) {
4248 if result .Response .Summary != "Timezone updated" {
4349 t .Errorf ("expected timezone summary, got %q" , result .Response .Summary )
4450 }
51+ if got := responseDataMap (t , result )["updated_at" ]; got != "2026-06-03T21:15:00Z" {
52+ t .Errorf ("expected timezone response body updated_at, got %#v" , got )
53+ }
54+ })
55+
56+ t .Run ("falls back to requested timezone for empty response" , func (t * testing.T ) {
57+ mock := NewMockClient ()
58+ mock .PatchResponse = & client.APIResponse {StatusCode : 204 , Data : nil }
59+
60+ result := SetTestModeWithSDK (mock )
61+ SetTestConfig ("token" , "account" , "https://api.example.com" )
62+ identityTimezoneUpdateTimezone = "America/New_York"
63+ defer func () {
64+ identityTimezoneUpdateTimezone = ""
65+ resetTest ()
66+ }()
67+
68+ err := identityTimezoneUpdateCmd .RunE (identityTimezoneUpdateCmd , []string {})
69+ assertExitCode (t , err , 0 )
70+
71+ if got := responseDataMap (t , result )["timezone_name" ]; got != "America/New_York" {
72+ t .Errorf ("expected fallback timezone_name, got %#v" , got )
73+ }
4574 })
4675
4776 t .Run ("requires timezone" , func (t * testing.T ) {
0 commit comments