File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -364,6 +364,7 @@ export class YepCodeApi {
364364 async getProcesses (
365365 params : {
366366 keywords ?: string ;
367+ tags ?: string [ ] ;
367368 page ?: number ;
368369 limit ?: number ;
369370 } = { }
Original file line number Diff line number Diff line change 1+ import { YepCodeApi } from "../../src/api/yepcodeApi" ;
2+ import { ProcessesPaginatedResult } from "../../src/api/types" ;
3+
4+ const api = new YepCodeApi ( ) ;
5+
6+ describe ( "YepCodeApi" , ( ) => {
7+ describe ( "processes" , ( ) => {
8+ it ( "should return a paginated list of processes" , async ( ) => {
9+ const result : ProcessesPaginatedResult = await api . getProcesses ( ) ;
10+
11+ expect ( result ) . toHaveProperty ( "hasNextPage" ) ;
12+ expect ( result ) . toHaveProperty ( "page" ) ;
13+ expect ( result ) . toHaveProperty ( "limit" ) ;
14+ expect ( result ) . toHaveProperty ( "total" ) ;
15+ expect ( result ) . toHaveProperty ( "data" ) ;
16+ expect ( Array . isArray ( result . data ) ) . toBe ( true ) ;
17+ } ) ;
18+
19+ it ( "should return a paginated list of processes with a tag" , async ( ) => {
20+ const result : ProcessesPaginatedResult = await api . getProcesses ( {
21+ tags : [ "yc-run" , "dummy" ] ,
22+ } ) ;
23+
24+ expect ( result ) . toHaveProperty ( "hasNextPage" ) ;
25+ expect ( result ) . toHaveProperty ( "page" ) ;
26+ expect ( result ) . toHaveProperty ( "limit" ) ;
27+ expect ( result ) . toHaveProperty ( "total" ) ;
28+ expect ( result ) . toHaveProperty ( "data" ) ;
29+ expect ( Array . isArray ( result . data ) ) . toBe ( true ) ;
30+ } ) ;
31+ } ) ;
32+ } ) ;
You can’t perform that action at this time.
0 commit comments