import { expect } from "chai" ; import { getInstancesCount , KeySet } from "../presentation-common" ; import { createRandomBaseNodeKey , createRandomECInstanceKey , createRandomECInstancesNodeKey , createRandomGroupingNodeKey } from "./_helpers/random" ; describe ( "getInstancesCount" , ( ) => { it ( "calculates correct count with instance keys, instance node keys and grouping node keys" , ( ) => { const keys = new KeySet ( [ createRandomECInstanceKey ( ) , createRandomECInstancesNodeKey ( [ createRandomECInstanceKey ( ) , createRandomECInstanceKey ( ) ] ) , createRandomGroupingNodeKey ( 5 ) , createRandomBaseNodeKey ( ) , ] ) ; expect ( getInstancesCount ( keys ) ) . to . eq ( 8 ) ; } ) ; } ) ;