Sha256: aa3641b5422e0857474b08af12452892af96451289a182a634e8754be56ba748

Contents?: true

Size: 1005 Bytes

Versions: 5

Compression:

Stored size: 1005 Bytes

Contents

class Teaspoon.Reporters.HTML.SuiteView extends Teaspoon.Reporters.BaseView

  viewId = 0

  constructor: (@suite, @reporter) ->
    @views = @reporter.views
    @suite.viewId = viewId += 1
    @views.suites[@suite.viewId] = @
    @suite = new Teaspoon.Suite(suite)
    super


  build: ->
    super("suite")
    @el.innerHTML = """<h1><a href="#{@suite.link}">#{@suite.description}</a></h1>"""
    @parentView = @buildParent()
    @parentView.append(@el)


  buildParent: ->
    parent = @suite.parent
    return @reporter unless parent
    if parent.viewId
      @views.suites[parent.viewId]
    else
      view = new Teaspoon.Reporters.HTML.SuiteView(parent, @reporter)
      @views.suites[view.suite.viewId] = view


  append: (el) ->
    super(@ol = @createEl("ol")) unless @ol
    @ol.appendChild(el)


  updateState: (state) ->
    return if @state == "failed"
    @el.className = "#{@el.className.replace(/\s?state-\w+/, "")} state-#{state}"
    @parentView.updateState?(state)
    @state = state

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
teaspoon-0.7.8 app/assets/javascripts/teaspoon/base/reporters/html/suite_view.coffee
teaspoon-0.7.7 app/assets/javascripts/teaspoon/base/reporters/html/suite_view.coffee
teaspoon-0.7.6 app/assets/javascripts/teaspoon/base/reporters/html/suite_view.coffee
teaspoon-0.7.5 app/assets/javascripts/teaspoon/base/reporters/html/suite_view.coffee
teaspoon-0.7.4 app/assets/javascripts/teaspoon/base/reporters/html/suite_view.coffee