11import { PlaneClient } from "../../src/client/plane-client" ;
2- import { Initiative , UpdateInitiative } from "../../src/models/Initiative" ;
2+ import { Initiative , InitiativeState , UpdateInitiative } from "../../src/models/Initiative" ;
33import { InitiativeLabel } from "../../src/models/InitiativeLabel" ;
44import { Project } from "../../src/models/Project" ;
55import { Epic } from "../../src/models/Epic" ;
@@ -74,14 +74,14 @@ describeIf(!!(config.workspaceSlug && config.projectId), "Initiative API Tests",
7474 initiative = await client . initiatives . create ( workspaceSlug , {
7575 name : randomizeName ( "Test Initiative" ) ,
7676 description : "Test Initiative Description" ,
77- state : "DRAFT" ,
77+ state : InitiativeState . ACTIVE ,
7878 } ) ;
7979
8080 expect ( initiative ) . toBeDefined ( ) ;
8181 expect ( initiative . id ) . toBeDefined ( ) ;
8282 expect ( initiative . name ) . toContain ( "Test Initiative" ) ;
8383 expect ( initiative . description ) . toBe ( "Test Initiative Description" ) ;
84- expect ( initiative . state ) . toBe ( "DRAFT" ) ;
84+ expect ( initiative . state ) . toBe ( InitiativeState . ACTIVE ) ;
8585 } ) ;
8686
8787 it ( "should retrieve an initiative" , async ( ) => {
@@ -90,19 +90,22 @@ describeIf(!!(config.workspaceSlug && config.projectId), "Initiative API Tests",
9090 expect ( retrievedInitiative ) . toBeDefined ( ) ;
9191 expect ( retrievedInitiative . id ) . toBe ( initiative . id ) ;
9292 expect ( retrievedInitiative . name ) . toBe ( initiative . name ) ;
93+ expect ( retrievedInitiative . state ) . toBe ( initiative . state ) ;
9394 } ) ;
9495
9596 it ( "should update an initiative" , async ( ) => {
9697 const updateData : UpdateInitiative = {
9798 name : randomizeName ( "Updated Test Initiative" ) ,
9899 description : "Updated Test Initiative Description" ,
100+ state : InitiativeState . PLANNED ,
99101 } ;
100102
101103 const updatedInitiative = await client . initiatives . update ( workspaceSlug , initiative . id , updateData ) ;
102104
103105 expect ( updatedInitiative ) . toBeDefined ( ) ;
104106 expect ( updatedInitiative . id ) . toBe ( initiative . id ) ;
105107 expect ( updatedInitiative . name ) . toContain ( "Updated Test Initiative" ) ;
108+ expect ( updatedInitiative . state ) . toBe ( InitiativeState . PLANNED ) ;
106109 } ) ;
107110
108111 it ( "should list initiatives" , async ( ) => {
0 commit comments