Merge branch 'master' of github.com:travis-ci/travis-web
This commit is contained in:
commit
e498c9bd53
|
@ -13,6 +13,10 @@
|
|||
Travis.setLocale Travis.default_locale
|
||||
@set('state', 'signed-out')
|
||||
@set('user', undefined)
|
||||
user = Travis.__container__.lookup('controller:currentUser').get('content')
|
||||
if user.get('stateManager.currentPath') == 'rootState.loaded.updated.uncommitted'
|
||||
user.send('rollback')
|
||||
user.unloadRecord()
|
||||
Travis.__container__.lookup('controller:currentUser').set('content', null)
|
||||
Travis.__container__.lookup('router:main').send('afterSignOut')
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ require 'travis/model'
|
|||
init: ->
|
||||
@_super()
|
||||
|
||||
# TODO: the next line fails, check this
|
||||
#@poll() if @get('isSyncing')
|
||||
Ember.run.next this, ->
|
||||
@poll() if @get('isSyncing')
|
||||
|
||||
Ember.run.next this, ->
|
||||
transaction = @get('store').transaction()
|
||||
|
|
|
@ -7,7 +7,7 @@ Travis.reopen
|
|||
@rerender()
|
||||
).observes('templateName')
|
||||
|
||||
click: ->
|
||||
click: (event) ->
|
||||
# TODO: this solves the case of closing menus and popups,
|
||||
# but I would like to rewrite it later, not sure how
|
||||
# yet, but this does not seem optimal
|
||||
|
|
|
@ -83,7 +83,7 @@ Travis.reopen
|
|||
$('#log').on 'mouseenter', 'a', ->
|
||||
$(@).attr('href', '#L' + ($("#log p:visible").index(@parentNode) + 1))
|
||||
|
||||
click: ->
|
||||
click: (event) ->
|
||||
if (href = $(event.target).attr('href')) && matches = href?.match(/#L(\d+)$/)
|
||||
@lineNumberClicked(matches[1])
|
||||
event.stopPropagation()
|
||||
|
|
|
@ -3,7 +3,7 @@ describe 'on the "job" state', ->
|
|||
$.mockjax
|
||||
url: '/jobs/1/log?cors_hax=true'
|
||||
responseTime: 0
|
||||
responseText: 'log 1'
|
||||
responseText: "First line\ncontent:travis_fold:start:install\r$ Install something\nInstalling something\ncontent:travis_fold:end:install\r$ End"
|
||||
|
||||
|
||||
app 'travis-ci/travis-core/jobs/1'
|
||||
|
@ -41,9 +41,22 @@ describe 'on the "job" state', ->
|
|||
job: { href: '/travis-ci/travis-core/jobs/1', active: true }
|
||||
|
||||
displaysLog [
|
||||
'log 1'
|
||||
'First line',
|
||||
'$ Install something',
|
||||
'Installing something',
|
||||
'$ End'
|
||||
]
|
||||
|
||||
it 'allows to expand folds', ->
|
||||
waits 100
|
||||
runs ->
|
||||
expect($('#fold-start-install').hasClass('open')).toBeFalsy()
|
||||
$('#fold-start-install').click()
|
||||
waits 20
|
||||
runs ->
|
||||
expect($('#fold-start-install').hasClass('open')).toBeTruthy()
|
||||
|
||||
|
||||
describe 'too long log', ->
|
||||
beforeEach ->
|
||||
$.mockjax
|
||||
|
@ -51,22 +64,20 @@ describe 'too long log', ->
|
|||
responseTime: 0
|
||||
responseText: '1\n2\n3\n4\n5\n6\n7\n8\n9\n10'
|
||||
|
||||
Travis.OrderedLog.reopen
|
||||
linesLimit: 5
|
||||
Log.LIMIT = 5
|
||||
|
||||
app 'travis-ci/travis-core/jobs/2'
|
||||
waitFor logRendered
|
||||
|
||||
afterEach ->
|
||||
Travis.OrderedLog.reopen
|
||||
linesLimit: 5000
|
||||
Log.LIMIT = 10000
|
||||
|
||||
it 'is cut after given limit', ->
|
||||
displaysLog [
|
||||
'12345'
|
||||
]
|
||||
|
||||
expect( $('#log .cut').text() ).toEqual 'Log was too long to display. Download the the raw version to get the full log.'
|
||||
expect( $('#log .cut a').attr('href') ).toEqual '/jobs/2/log.txt?deansi=true'
|
||||
expect( $('#log-container .warning').text() ).toMatch /This log is too long to be displayed/
|
||||
expect( $('#log-container .warning a').attr('href') ).toEqual '/jobs/2/log.txt?deansi=true'
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
expect(element.text()).toEqual data.message
|
||||
|
||||
@displaysLog = (lines) ->
|
||||
log = lines.join()
|
||||
log = lines.join('')
|
||||
expect($('#log p').text().trim()).toEqual log
|
||||
|
||||
@listsRepos = (items) ->
|
||||
|
|
Loading…
Reference in New Issue
Block a user