@@ -2,8 +2,6 @@ import { StatusCodes } from 'http-status-codes';
22
33import type { FastifyInstance } from 'fastify' ;
44
5- import { ItemType } from '@graasp/sdk' ;
6-
75import build , { clearDatabase , mockAuthenticate } from '../../../test/app' ;
86import { seedFromJson } from '../../../test/mocks/seed' ;
97import { db } from '../../drizzle/db' ;
@@ -59,9 +57,9 @@ describe('Item controller', () => {
5957 {
6058 memberships : [ { account : 'actor' , permission : 'admin' } ] ,
6159 children : [
62- { type : ItemType . FOLDER } ,
63- { isHidden : true , type : ItemType . DOCUMENT } ,
64- { isPublic : true , type : ItemType . DOCUMENT } ,
60+ { type : 'folder' } ,
61+ { isHidden : true , type : 'document' } ,
62+ { isPublic : true , type : 'document' } ,
6563 ] ,
6664 } ,
6765 ] ,
@@ -71,7 +69,7 @@ describe('Item controller', () => {
7169 mockAuthenticate ( actor ) ;
7270 const response = await app . inject ( {
7371 method : 'GET' ,
74- url : `/api/items/${ rootUUID } /descendants?types=${ ItemType . FOLDER } ` ,
72+ url : `/api/items/${ rootUUID } /descendants?types=${ 'folder' } ` ,
7573 } ) ;
7674 expect ( response . statusCode ) . toBe ( StatusCodes . OK ) ;
7775 const json = response . json ( ) ;
@@ -87,11 +85,7 @@ describe('Item controller', () => {
8785 items : [
8886 {
8987 memberships : [ { account : 'actor' , permission : 'admin' } ] ,
90- children : [
91- { } ,
92- { isHidden : true , type : ItemType . APP } ,
93- { isPublic : true , type : ItemType . APP } ,
94- ] ,
88+ children : [ { } , { isHidden : true , type : 'app' } , { isPublic : true , type : 'app' } ] ,
9589 } ,
9690 ] ,
9791 } ) ;
@@ -100,7 +94,7 @@ describe('Item controller', () => {
10094 mockAuthenticate ( actor ) ;
10195 const response = await app . inject ( {
10296 method : 'GET' ,
103- url : `/api/items/${ rootUUID } /descendants?types=${ ItemType . APP } ` ,
97+ url : `/api/items/${ rootUUID } /descendants?types=${ 'app' } ` ,
10498 } ) ;
10599 expect ( response . statusCode ) . toBe ( StatusCodes . OK ) ;
106100 const json = response . json ( ) ;
0 commit comments