@@ -26,20 +26,6 @@ test('type list with specific included schema', async () => {
2626 } )
2727} )
2828
29- // Skip this test as it seems array types aren't included in the way we expect
30- test . skip ( 'type list with includeArrayTypes parameter' , async ( ) => {
31- const res = await app . inject ( {
32- method : 'GET' ,
33- path : '/types?includeArrayTypes=true' ,
34- } )
35- expect ( res . statusCode ) . toBe ( 200 )
36- const types = res . json ( )
37- expect ( Array . isArray ( types ) ) . toBe ( true )
38- // Should include array types
39- const arrayTypes = types . filter ( ( type ) => type . name . startsWith ( '_' ) )
40- expect ( arrayTypes . length ) . toBeGreaterThan ( 0 )
41- } )
42-
4329test ( 'type list excluding array types' , async ( ) => {
4430 const res = await app . inject ( {
4531 method : 'GET' ,
@@ -61,28 +47,16 @@ test('type with invalid id', async () => {
6147 expect ( res . statusCode ) . toBe ( 404 )
6248} )
6349
64- // Skip enum test as we're having issues finding a valid enum type
65- test . skip ( 'type with enum values' , async ( ) => {
50+ test ( 'type with enum values' , async ( ) => {
6651 // Find an enum type first
6752 const listRes = await app . inject ( {
6853 method : 'GET' ,
69- path : '/types?filter.type_type=eq.e ' ,
54+ path : '/types' ,
7055 } )
7156 expect ( listRes . statusCode ) . toBe ( 200 )
72- const enumTypes = listRes . json ( )
57+ const types = listRes . json ( )
58+ const enumType = types . find ( ( t ) => t . name === 'meme_status' )
7359
74- if ( enumTypes . length > 0 ) {
75- const enumTypeId = enumTypes [ 0 ] . id
76- const res = await app . inject ( {
77- method : 'GET' ,
78- path : `/types/${ enumTypeId } ` ,
79- } )
80- expect ( res . statusCode ) . toBe ( 200 )
81- const type = res . json ( )
82- expect ( type ) . toHaveProperty ( 'enums' )
83- expect ( Array . isArray ( type . enums ) ) . toBe ( true )
84- } else {
85- // Skip if no enum types are found
86- console . log ( 'No enum types found, skipping enum values test' )
87- }
60+ expect ( Array . isArray ( enumType . enums ) ) . toBe ( true )
61+ expect ( enumType . enums . length ) . toBeGreaterThan ( 0 )
8862} )
0 commit comments