@@ -120,6 +120,39 @@ describe('restClient', () => {
120120 expect ( result ) . toBe ( 'filter=today&ids=1%2C2%2C3' )
121121 } )
122122
123+ test ( 'GET request converts camelCase parameters to snake_case in URL' , async ( ) => {
124+ mockSuccessfulResponse ( DEFAULT_RESPONSE_DATA )
125+
126+ await request ( {
127+ httpMethod : 'GET' ,
128+ baseUri : DEFAULT_BASE_URI ,
129+ relativePath : DEFAULT_ENDPOINT ,
130+ apiToken : DEFAULT_AUTH_TOKEN ,
131+ payload : {
132+ projectId : '123' ,
133+ isCompleted : true ,
134+ parentItemId : '456' ,
135+ dueDatetime : '2024-01-01T12:00:00Z' ,
136+ } ,
137+ } )
138+
139+ // Verify the fetch was called with URL containing snake_case parameters
140+ expect ( mockFetch ) . toHaveBeenCalledWith (
141+ expect . stringContaining ( 'project_id=123' ) ,
142+ expect . objectContaining ( {
143+ method : 'GET' ,
144+ headers : AUTHORIZATION_HEADERS ,
145+ } ) ,
146+ )
147+
148+ // Verify all camelCase parameters were converted to snake_case
149+ const [ actualUrl ] = mockFetch . mock . calls [ 0 ]
150+ expect ( actualUrl ) . toContain ( 'project_id=123' )
151+ expect ( actualUrl ) . toContain ( 'is_completed=true' )
152+ expect ( actualUrl ) . toContain ( 'parent_item_id=456' )
153+ expect ( actualUrl ) . toContain ( 'due_datetime=2024-01-01T12%3A00%3A00Z' )
154+ } )
155+
123156 test ( 'POST request with JSON payload' , async ( ) => {
124157 mockSuccessfulResponse ( DEFAULT_RESPONSE_DATA )
125158
0 commit comments