@@ -765,40 +765,38 @@ describe("checkHealth", () => {
765765 } ) ;
766766} ) ;
767767
768- describe ( "getHistory " , ( ) => {
769- test ( "success without params" , async ( ) => {
768+ describe ( "history " , ( ) => {
769+ test ( "list success without params" , async ( ) => {
770770 const body = {
771771 data : [ ] ,
772772 pagination : { page : 1 , limit : 20 , total : 0 } ,
773773 } ;
774774 fetchSpy = spyOn ( globalThis , "fetch" ) . mockResolvedValueOnce ( json ( body ) ) ;
775775
776- const res = await sdk . getHistory ( API_KEY ) ;
776+ const res = await sdk . history . list ( API_KEY ) ;
777777
778778 expect ( res . status ) . toBe ( "success" ) ;
779779 expect ( res . data ) . toEqual ( body ) ;
780780 expectRequest ( 0 , "GET" , "/history" ) ;
781781 } ) ;
782782
783- test ( "success with params" , async ( ) => {
783+ test ( "list success with params" , async ( ) => {
784784 const body = {
785785 data : [ ] ,
786786 pagination : { page : 2 , limit : 10 , total : 50 } ,
787787 } ;
788788 fetchSpy = spyOn ( globalThis , "fetch" ) . mockResolvedValueOnce ( json ( body ) ) ;
789789
790- const res = await sdk . getHistory ( API_KEY , { page : 2 , limit : 10 , service : "scrape" } ) ;
790+ const res = await sdk . history . list ( API_KEY , { page : 2 , limit : 10 , service : "scrape" } ) ;
791791
792792 expect ( res . status ) . toBe ( "success" ) ;
793793 const [ url ] = fetchSpy . mock . calls [ 0 ] as [ string , RequestInit ] ;
794794 expect ( url ) . toContain ( "page=2" ) ;
795795 expect ( url ) . toContain ( "limit=10" ) ;
796796 expect ( url ) . toContain ( "service=scrape" ) ;
797797 } ) ;
798- } ) ;
799798
800- describe ( "getHistoryEntry" , ( ) => {
801- test ( "success" , async ( ) => {
799+ test ( "get success" , async ( ) => {
802800 const body = {
803801 id : "abc-123" ,
804802 service : "scrape" ,
@@ -808,7 +806,7 @@ describe("getHistoryEntry", () => {
808806 } ;
809807 fetchSpy = spyOn ( globalThis , "fetch" ) . mockResolvedValueOnce ( json ( body ) ) ;
810808
811- const res = await sdk . getHistoryEntry ( API_KEY , "abc-123" ) ;
809+ const res = await sdk . history . get ( API_KEY , "abc-123" ) ;
812810
813811 expect ( res . status ) . toBe ( "success" ) ;
814812 expect ( res . data ) . toEqual ( body ) ;
0 commit comments