11import { createTestClient , randomizeName , wait } from "../helpers/test-utils" ;
22import { e2eConfig } from "./config" ;
3- import { Project , Cycle , Module , WorkItem } from "../../src/models" ;
3+ import { Project , Cycle , Module , WorkItem , Page } from "../../src/models" ;
44
55describe ( "End to End Project Test" , ( ) => {
66 // Shared state across tests
@@ -9,6 +9,7 @@ describe("End to End Project Test", () => {
99 let project : Project ;
1010 let cycle : Cycle ;
1111 let module : Module ;
12+ let page : Page ;
1213 let workItem1 : WorkItem ;
1314 let workItem2 : WorkItem ;
1415 let workItem3 : WorkItem ;
@@ -31,6 +32,7 @@ describe("End to End Project Test", () => {
3132 await client . projects . updateFeatures ( e2eConfig . workspaceSlug , project . id , {
3233 cycles : true ,
3334 modules : true ,
35+ pages : true ,
3436 } ) ;
3537 } ) ;
3638
@@ -72,6 +74,22 @@ describe("End to End Project Test", () => {
7274 expect ( modules . results . find ( ( m ) => m . name === module . name ) ) . toBeDefined ( ) ;
7375 } ) ;
7476
77+ it ( "should create and list pages" , async ( ) => {
78+ const pageName = randomizeName ( "Test Page" ) ;
79+ page = await client . pages . createProjectPage ( e2eConfig . workspaceSlug , project . id , {
80+ name : pageName ,
81+ description_html : "<p>Test Page Description</p>" ,
82+ } ) ;
83+
84+ expect ( page ) . toBeDefined ( ) ;
85+ expect ( page . id ) . toBeDefined ( ) ;
86+ expect ( page . name ) . toBe ( pageName ) ;
87+
88+ const pages = await client . pages . listProjectPages ( e2eConfig . workspaceSlug , project . id ) ;
89+ expect ( pages . results . length ) . toBeGreaterThan ( 0 ) ;
90+ expect ( pages . results . find ( ( p ) => p . name === page . name ) ) . toBeDefined ( ) ;
91+ } ) ;
92+
7593 it ( "should create work items with assignees" , async ( ) => {
7694 workItem1 = await client . workItems . create ( e2eConfig . workspaceSlug , project . id , {
7795 name : randomizeName ( "Test Work Item 1" ) ,
@@ -126,10 +144,7 @@ describe("End to End Project Test", () => {
126144 and : [
127145 ...( stateId ? [ { state_id : stateId } ] : [ ] ) ,
128146 {
129- or : [
130- { priority : "none" } ,
131- { priority : "high" } ,
132- ] ,
147+ or : [ { priority : "none" } , { priority : "high" } ] ,
133148 } ,
134149 ] ,
135150 } ,
0 commit comments