import { expect } from "chai" ; import { isTreeDataProviderInterface , isTreeDataProviderMethod , isTreeDataProviderPromise , isTreeDataProviderRaw , ITreeDataProvider , TreeDataProviderMethod , TreeDataProviderPromise , TreeDataProviderRaw , } from "../../components-react/tree/TreeDataProvider" ; describe ( "TreeDataProvider" , ( ) => { const emptyRawProvider = [ ] ; const emptyPromiseProvider = Promise . resolve ( emptyRawProvider ) ; const emptyMethodProvider = async ( ) => emptyPromiseProvider ; const emptyInterfaceProvider = { getNodesCount : async ( ) => 0 , getNodes : emptyMethodProvider } ; describe ( "isTreeDataProviderRaw" , ( ) => { it ( "returns expected results" , ( ) => { expect ( isTreeDataProviderRaw ( emptyRawProvider ) ) . to . be . true ; expect ( isTreeDataProviderRaw ( emptyPromiseProvider ) ) . to . be . false ; expect ( isTreeDataProviderRaw ( emptyMethodProvider ) ) . to . be . false ; expect ( isTreeDataProviderRaw ( emptyInterfaceProvider ) ) . to . be . false ; } ) ; } ) ; describe ( "isTreeDataProviderPromise" , ( ) => { it ( "returns expected results" , ( ) => { expect ( isTreeDataProviderPromise ( emptyRawProvider ) ) . to . be . false ; expect ( isTreeDataProviderPromise ( emptyPromiseProvider ) ) . to . be . true ; expect ( isTreeDataProviderPromise ( emptyMethodProvider ) ) . to . be . false ; expect ( isTreeDataProviderPromise ( emptyInterfaceProvider ) ) . to . be . false ; } ) ; } ) ; describe ( "isTreeDataProviderMethod" , ( ) => { it ( "returns expected results" , ( ) => { expect ( isTreeDataProviderMethod ( emptyRawProvider ) ) . to . be . false ; expect ( isTreeDataProviderMethod ( emptyPromiseProvider ) ) . to . be . false ; expect ( isTreeDataProviderMethod ( emptyMethodProvider ) ) . to . be . true ; expect ( isTreeDataProviderMethod ( emptyInterfaceProvider ) ) . to . be . false ; } ) ; } ) ; describe ( "isTreeDataProviderInterface" , ( ) => { it ( "returns expected results" , ( ) => { expect ( isTreeDataProviderInterface ( emptyRawProvider ) ) . to . be . false ; expect ( isTreeDataProviderInterface ( emptyPromiseProvider ) ) . to . be . false ; expect ( isTreeDataProviderInterface ( emptyMethodProvider ) ) . to . be . false ; expect ( isTreeDataProviderInterface ( emptyInterfaceProvider ) ) . to . be . true ; } ) ; } ) ; } ) ;