import TopologyManager from '@/domain/models/TopologyManager.js'
import {ROUTU_OBJECT_INPUT, ROUTE_OBJECT_OUTPUT, TOPOLOGY_COLLECTION, ROUTE_TOPOLOGYLIST_OUTPUT, END_POINT } from "../../../mock/deviceState/ElineManagerMock"

describe ('TopologyManager', () => {
  it("should findDeviceByKey", () => {

    let topologyCollection = TOPOLOGY_COLLECTION

    let topologyMgr = TopologyManager(topologyCollection)
    let topology = topologyMgr.findTopologyByKey("111")
    expect(topology).to.eql(topologyCollection["111"])
  })

  it("should getRouteDeviceList", () => {
    let topologyCollection = TOPOLOGY_COLLECTION
    let pathList = ROUTU_OBJECT_INPUT
    let point = END_POINT

    let newTopologyList = ROUTE_TOPOLOGYLIST_OUTPUT

    let topologyMgr = TopologyManager(topologyCollection)
    let newList = topologyMgr.getRouteDeviceList(pathList, point)
    expect(newList).to.eql(newTopologyList)
  })

  it("should handleRoutePathList", () => {

    let topologyCollection = TOPOLOGY_COLLECTION
    let pathList = ROUTU_OBJECT_INPUT
    let outputList = ROUTE_OBJECT_OUTPUT

    let topologyMgr = TopologyManager(topologyCollection)
    let newPathList = topologyMgr.handleRoutePathList(pathList)
    expect(newPathList).to.eql(outputList)
  })
})

