From 2a83215fdccd314e9549faae2779ca7b7a79a690 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Thu, 3 Oct 2013 21:23:49 -0400 Subject: [PATCH 1/2] Fixed clearing log --- assets/scripts/app/views/log.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/scripts/app/views/log.coffee b/assets/scripts/app/views/log.coffee index 5bd671a7..47503c34 100644 --- a/assets/scripts/app/views/log.coffee +++ b/assets/scripts/app/views/log.coffee @@ -34,7 +34,7 @@ Travis.reopen parts.removeArrayObserver(@, didChange: 'partsDidChange', willChange: 'noop') versionDidChange: (-> - @rerender() if @get('inDOM') + @rerender() if @get('state') == 'inDOM' ).observes('log.version') logDidChange: (-> From 7218655cf41349214d9b6e98bfeb4209f10dfba5 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Fri, 4 Oct 2013 15:17:46 -0400 Subject: [PATCH 2/2] Added tests for clearing log when a job is started or requeued --- .../spec/integration/event_spec.coffee | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/assets/scripts/spec/integration/event_spec.coffee b/assets/scripts/spec/integration/event_spec.coffee index 9c2ba882..26b8eac3 100644 --- a/assets/scripts/spec/integration/event_spec.coffee +++ b/assets/scripts/spec/integration/event_spec.coffee @@ -35,6 +35,40 @@ test "event containing a repository, adds repository to repos list", -> row: 2 item: { slug: 'travis-ci/travis-support', build: { number: 4, url: '/travis-ci/travis-support/builds/10', duration: '1 min 30 sec', finishedAt: 'less than a minute ago' } } + +test "an event containing a created job, clears the job's log", -> + payload = + job: + id: 12 + repository_id: 1 + number: '1.4' + queue: 'build.linux' + + visit('/travis-ci/travis-core/').then -> + Em.run -> + logRendered() + Travis.receive 'build:created', payload + + wait().then -> + displaysLog [] + +test "an event containing a requeued job, clears the job's log", -> + payload = + job: + id: 12 + repository_id: 1 + number: '1.4' + queue: 'build.linux' + + visit('/travis-ci/travis-core').then -> + Em.run -> + logRendered() + Travis.receive 'build:requeued', payload + + wait().then -> + displaysLog [] + + test "an event with a build adds a build to a builds list", -> visit('/travis-ci/travis-core/builds').then -> payload = @@ -62,6 +96,7 @@ test "an event with a build adds a build to a builds list", -> row: 1 item: { id: 11, slug: 'travis-ci/travis-core', number: '3', sha: '1234567', branch: 'master', message: 'commit message 3', finishedAt: 'less than a minute ago', duration: '55 sec', color: 'red' } + #test "event containing a job, adds job to jobs list", -> # visit('travis-ci/travis-core').then -> # payload =