/* global describe, it */
import { expect } from 'chai'
import outdent from 'outdent'
import XMLParser from '../../src/MetamapsXMLParser'
describe('Metamaps.XMLParser.js', function() {
describe('parseSchema', function() {
it('View:Projection nodes', function() {
const xml = outdent`
`
{ topics, synapses } = XMLParser.parseSchema(xml)
expect(topics[0].name).to.equal("NTREE_DATA")
expect(topics[0].metacode).to.equal("Activity")
expect(topics[1].name).to.equal("MANDT")
expect(topics[1].metacode).to.equal("Wildcard")
expect(synapses.length).to.equal(0)
})
it('lays nodes out correctly', function() {
const xml = outdent`
`
{ topics, synapses } = XMLParser.parseSchema(xml)
expect(topics[0].x).to.equal(176)
expect(topics[0].y).to.equal(569)
expect(topics[1].x).to.equal(176 + 20)
expect(topics[1].y).to.equal(569)
})
})
})