assert = (require 'chai').assert
View   = require '../../../view/View'
ViewModel = require 'stout-core/view/ViewModel'



describe 'view/View', ->
  v = null

  beforeEach ->
    v = new View context: new ViewModel, template: ''


  it 'has a #classes property', ->
    assert.property v, 'classes'

  it 'has an #events property', ->
    assert.property v, 'events'

  it 'the #events property defaults to {}', ->
    assert.deepEqual v.events, {}

  it 'has an #id property', ->
    assert.property v, 'id'

  it 'has a #parent property', ->
    assert.property v, 'parent'

  it 'has a #prefix property', ->
    assert.property v, 'prefix'

  it 'has a #prefixedClasses property', ->
    assert.property v, 'prefixedClasses'

  it 'has a #root property', ->
    assert.property v, 'root'

  it 'has a #tagName property', ->
    assert.property v, 'tagName'

  it 'the #tagName property default is `DIV`', ->
    assert.equal v.tagName, 'DIV'

  it 'has a #viewClasses property', ->
    assert.property v, 'viewClasses'

  it 'the #viewClasses property defaults to an empty object', ->
    assert.deepEqual v.viewClasses, {}

  it 'has an #emptyRoot() method', ->
    assert.isFunction v.emptyRoot

  it 'has an #render() method', ->
    assert.isFunction v.render

  it 'has an #select() method', ->
    assert.isFunction v.select

  it 'has an #selectAll() method', ->
    assert.isFunction v.selectAll

  it 'has an #unrender() method', ->
    assert.isFunction v.unrender
