Sha256: 3036c7af246d7b36d3702f81d47712ab6c10a14bb71ef292d857ec9e694417c6

Contents?: true

Size: 997 Bytes

Versions: 19

Compression:

Stored size: 997 Bytes

Contents

class Teabag.Reporters.HTML.SuiteView extends Teabag.Reporters.BaseView

  viewId = 0

  constructor: (@suite, @reporter) ->
    @views = @reporter.views
    @suite.viewId = viewId += 1
    @views.suites[@suite.viewId] = @
    @suite = new Teabag.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 Teabag.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

19 entries across 19 versions & 1 rubygems

Version Path
teabag-0.7.3 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.7.2 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.7.1 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.7.0 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.6.0 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.5.5 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.5.4 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.5.3 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.5.2 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.5.1 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.5.0 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.4.6 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.4.5 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.4.4 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.4.3 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.4.2 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.4.1 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.4.0 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee
teabag-0.3.6 app/assets/javascripts/teabag/base/reporters/html/suite_view.coffee