-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Should additionaly fix #4
- Loading branch information
Showing
12 changed files
with
221 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ CompositeDisposable } = require 'atom' | ||
{ View, $ } = require 'atom-space-pen-views' | ||
AtoumReportTreeviewLeafView = require './report-treeview-leaf' | ||
|
||
module.exports = | ||
class AtoumReportTreeviewBranchView extends View | ||
@icons: | ||
'ok': 'icon-check text-success' | ||
'skip': 'icon-arrow-right text-warning' | ||
'void': 'icon-primitive-dot text-info' | ||
'not ok': 'icon-flame text-danger' | ||
|
||
@content: (@test) -> | ||
@li 'data-class': @test.class.replace(/\\/g, '/'), class: 'entry list-nested-item collapsed', => | ||
@div outlet: 'header', class: 'header list-item', click: 'toggle', => | ||
@i outlet: 'icon', class: 'icon ' + @icons[@test.status] | ||
@span class: 'name', @test.class | ||
@ol outlet: 'leafs', class: 'entries list-tree' | ||
|
||
toggle: -> | ||
@header.toggleClass('collapsed').toggleClass('expanded') | ||
|
||
testDidFinish: (test) -> | ||
if test.status isnt 'ok' and not @icon.hasClass(icons['not ok']) | ||
@icon | ||
.removeClass(icons['ok']) | ||
.removeClass(icons['skip']) | ||
.removeClass(icons['void']) | ||
.addClass(icons[test.status]) | ||
|
||
@leafs.append new AtoumReportTreeviewLeafView test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ CompositeDisposable } = require 'atom' | ||
{ View, $ } = require 'atom-space-pen-views' | ||
|
||
module.exports = | ||
class AtoumReportTreeviewBranchView extends View | ||
@icons: | ||
'ok': 'icon-check text-success' | ||
'skip': 'icon-arrow-right text-warning' | ||
'void': 'icon-primitive-dot text-info' | ||
'not ok': 'icon-flame text-danger' | ||
|
||
@content: (@test) -> | ||
@li class: 'entry list-item', => | ||
@i outlet: 'icon', class: 'icon ' + @icons[@test.status] | ||
@span class: 'name', @test.method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ CompositeDisposable } = require 'atom' | ||
{ View, $ } = require 'atom-space-pen-views' | ||
AtoumReportTreeviewBranchView = require './report-treeview-branch' | ||
|
||
module.exports = | ||
class AtoumReportTreeviewView extends View | ||
@content: -> | ||
@ol outlet: 'treeView', class: 'tree-view list-tree has-collapsable-children focusable-panel' | ||
|
||
runnerDidStart: -> | ||
@reset() | ||
|
||
testDidFinish: (test) -> | ||
icons = | ||
'ok': 'icon-check text-success' | ||
'skip': 'icon-arrow-right text-warning' | ||
'void': 'icon-primitive-dot text-info' | ||
'not ok': 'icon-flame text-danger' | ||
colors = | ||
true: 'text-info' | ||
classId = test.class.replace(/\\/g, '/') | ||
|
||
if @treeView.find('[data-class="' + classId + '"]').size() is 0 | ||
@treeView.append new AtoumReportTreeviewBranchView test | ||
|
||
@treeView.find('[data-class="' + classId + '"]').get(0).view().testDidFinish test | ||
|
||
if test.status isnt 'ok' | ||
@treeView.find('[data-class="' + classId + '"] .entries .entry:last').on 'click', (event, elem) => | ||
@treeView.find('.selected').removeClass 'selected' | ||
$(event.delegateTarget).addClass 'selected' | ||
@treeView.siblings('div').find('.background-message').hide() | ||
@treeView.siblings('div').find('pre').html test.diag | ||
|
||
if test.file and not test.line | ||
@treeView.siblings('div').find('a').html test.file | ||
@treeView.siblings('div').find('a').on 'click', -> | ||
atom.workspace.open test.file, searchAllPanes: true | ||
|
||
if test.file and test.line | ||
@treeView.siblings('div').find('a').html test.file + ':' + test.line | ||
@treeView.siblings('div').find('a').on 'click', -> | ||
atom.workspace.open test.file, initialLine: test.line - 1, searchAllPanes: true | ||
|
||
reset: -> | ||
@treeView.html '' | ||
@treeView.siblings('div').find('pre').html '' | ||
@treeView.siblings('div').find('.background-message').css 'display', '' | ||
@treeView.siblings('div').find('a').html '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ View } = require 'atom-space-pen-views' | ||
AtoumConsoleView = require './console' | ||
AtoumReportView = require './report' | ||
|
||
module.exports = | ||
class AtoumResultButtonView extends View | ||
@content: (@model) -> | ||
@a click: 'toggleView', => | ||
@i outlet: 'viewButton', class: 'icon icon-list-unordered' | ||
|
||
initialize: (@model) -> | ||
@displayView() | ||
|
||
toggleView: -> | ||
if @model.view is 'report' | ||
@model.view = 'console' | ||
else | ||
@model.view = 'report' | ||
|
||
@displayView() | ||
|
||
displayView: -> | ||
if @model.view is 'console' | ||
@viewButton.addClass('icon-list-unordered').removeClass('icon-terminal') | ||
|
||
if @model.view is 'report' or not @model.view | ||
@viewButton.addClass('icon-terminal').removeClass('icon-list-unordered') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ View } = require 'atom-space-pen-views' | ||
AtoumConsoleView = require './console' | ||
AtoumReportView = require './report' | ||
AtoumResultButtonView = require './result-button' | ||
|
||
module.exports = | ||
class AtoumResultView extends View | ||
@content: (@model) -> | ||
@div => | ||
@subview 'console', new AtoumConsoleView | ||
@subview 'report', new AtoumReportView | ||
|
||
initialize: (@model) -> | ||
@displayView() | ||
|
||
button: -> | ||
@button = new AtoumResultButtonView @model | ||
@button.on 'click', => @displayView() | ||
|
||
runnerDidStart: -> | ||
@console.runnerDidStart() | ||
@report.runnerDidStart() | ||
|
||
runnerDidProduceOutput: (data) -> | ||
@console.runnerDidProduceOutput data | ||
|
||
runnerDidProduceError: (data) -> | ||
@console.runnerDidProduceError data | ||
|
||
runnerDidStop: -> | ||
@console.runnerDidStop() | ||
|
||
testDidFinish: (test) -> | ||
@report.testDidFinish test | ||
|
||
displayView: -> | ||
if @model.view is 'console' | ||
@console.css('display', '') | ||
@report.hide() | ||
|
||
if @model.view is 'report' or not @model.view | ||
@report.css('display', '') | ||
@console.hide() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters