import { SortedList } from '../../../src/util/sorted-list'

export default (createInstance) => {
  describe('#creatives', () => {
    it('gets creatives', () => {
      const inst = createInstance()
      expect(inst.creatives).to.be.an.instanceof(SortedList)
    })
  })

  describe('#impressions', () => {
    it('gets impressions', () => {
      const inst = createInstance()
      expect(inst.impressions).to.be.an.instanceof(Array)
    })
  })

  describe('#extensions', () => {
    it('gets extensions', () => {
      const inst = createInstance()
      expect(inst.extensions).to.be.an.instanceof(Array)
    })
  })

  describe('#id', () => {
    it('sets id', () => {
      const inst = createInstance()
      const value = 'dummy'
      inst.id = value
      expect(inst.id).to.equal(value)
    })
  })

  describe('#adSystem', () => {
    it('sets adSystem', () => {
      const inst = createInstance()
      const value = 'dummy'
      inst.adSystem = value
      expect(inst.adSystem).to.equal(value)
    })
  })

  describe('#error', () => {
    it('sets error', () => {
      const inst = createInstance()
      const value = 'https://example.com/error'
      inst.error = value
      expect(inst.error).to.equal(value)
    })
  })
}

@@ -1238,11 +1238,825 @@
  %7D)%0A  %7D)
+%0A%0A  describe('#errors', () =%3E %7B%0A    it('sets multiple errors', () =%3E %7B%0A      const inst = createInstance()%0A      const value1 = 'https://example.com/error'%0A      const value2 = 'https://example.com/error2'%0A      inst.errors.push(value1)%0A      inst.errors.push(value2)%0A      expect(inst.errors%5B0%5D).to.equal(value1)%0A      expect(inst.errors%5B1%5D).to.equal(value2)%0A    %7D)%0A    it('is backwards compatible with error getter', () =%3E %7B%0A      const inst = createInstance()%0A      const value = 'https://example.com/error'%0A      inst.errors.push(value)%0A      expect(inst.error).to.equal(value)%0A    %7D)%0A    it('is backwards compatible with error setter', () =%3E %7B%0A      const inst = createInstance()%0A      const value = 'https://example.com/error'%0A      inst.error = value%0A      expect(inst.errors%5B0%5D).to.equal(value)%0A    %7D)%0A  %7D)
 %0A%7D%0A

Add more tests for new errors property