import generalIconsMetadata , { deprecatedGeneralIcons , } from "../general/metadata" ; import * as generalIconComponents from "../general/dist" ; import systemIconsMetadata , { deprecatedSystemIcons } from "../system/metadata" ; import * as systemIconComponents from "../system/dist" ; import { IconMetadata } from "../types" ; const getFileNames = ( iconsMetadata ) => iconsMetadata . flatMap ( ( { sizes , aliases = [ ] } ) => { const fileNames = [ ... Object . values ( sizes ) , ... aliases ] ; return fileNames ; } ) ; const generalIconsWithMetadata = getFileNames ( generalIconsMetadata ) ; const systemIconsWithMetadata = getFileNames ( systemIconsMetadata ) ; describe ( "General icons metadata" , ( ) => { const generalIconComponentNames = Object . keys ( generalIconComponents ) ; const activeGeneralIcons = generalIconComponentNames . filter ( ( iconName ) => ! deprecatedGeneralIcons . includes ( iconName ) ) ; activeGeneralIcons . forEach ( ( iconName ) => { it ( `${ iconName } has metadata` , ( ) => { expect ( generalIconsWithMetadata . includes ( iconName ) ) . toBe ( true ) ; } ) ; } ) ; deprecatedGeneralIcons . forEach ( ( iconName ) => { it ( `${ iconName } is deprecated` , ( ) => { expect ( generalIconsWithMetadata . includes ( iconName ) ) . toBe ( false ) ; } ) ; } ) ; } ) ; describe ( "System icons metadata" , ( ) => { const systemIconComponentNames = Object . keys ( systemIconComponents ) ; const activeSystemIcons = systemIconComponentNames . filter ( ( iconName ) => ! deprecatedSystemIcons . includes ( iconName ) ) ; activeSystemIcons . forEach ( ( iconName ) => { it ( `${ iconName } has metadata` , ( ) => { expect ( systemIconsWithMetadata . includes ( iconName ) ) . toBe ( true ) ; } ) ; } ) ; deprecatedSystemIcons . forEach ( ( iconName ) => { it ( `${ iconName } is deprecated` , ( ) => { expect ( systemIconsWithMetadata . includes ( iconName ) ) . toBe ( false ) ; } ) ; } ) ; } ) ;