File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ export class EnumItemsArray<
103103
104104 // Collect custom meta fields
105105 const itemRaw = raw [ key ] ;
106- if ( itemRaw && typeof itemRaw === 'object' && 'value' in itemRaw ) {
106+ if ( itemRaw && typeof itemRaw === 'object' ) {
107107 Object . keys ( itemRaw ) . forEach ( ( k ) => {
108108 const metaKey = k as Exclude < keyof T [ keyof T ] , 'key' | 'value' | 'label' > ;
109109 if ( metaKey !== 'key' && metaKey !== 'value' && metaKey !== 'label' ) {
Original file line number Diff line number Diff line change @@ -101,6 +101,10 @@ const testCreatingEnum = (engine: TestEngineBase<'jest' | 'playwright'>) => {
101101 engine
102102 . expect ( Array . from ( weekEnum . items ) . map ( ( s ) => s . raw ) )
103103 . toEqual ( Object . values ( StandardWeekConfig ) . map ( ( { value, label, ...meta } ) => meta ) ) ;
104+
105+ engine . expect ( weekEnum . meta ) . toEqual ( {
106+ status : Object . values ( StandardWeekConfig ) . map ( ( { status } ) => status ) ,
107+ } ) ;
104108 }
105109 ) ;
106110
You can’t perform that action at this time.
0 commit comments