10037: Added test to check for progress bar showing only on running containers
authorLucas Di Pentima <lucas@curoverse.com>
Wed, 21 Sep 2016 21:19:23 +0000 (18:19 -0300)
committerLucas Di Pentima <lucas@curoverse.com>
Wed, 21 Sep 2016 21:19:23 +0000 (18:19 -0300)
apps/workbench/test/controllers/projects_controller_test.rb
services/api/test/fixtures/container_requests.yml

index fa87e849a26ce01f2068675d33ff740f82418d89..7848444efdeb84bcd2fc375ee6806b096b2153c9 100644 (file)
@@ -410,6 +410,23 @@ class ProjectsControllerTest < ActionController::TestCase
     end
   end
 
+  test "in dashboard the progress bar should only show on running containers" do
+    get :index, {}, session_for(:active)
+    assert_select 'div.panel-body.recent-processes' do
+      [
+        ['completed', false],
+        ['uncommitted', false],
+        ['queued', false],
+        ['running', true],
+      ].each do |cr_state, should_show|
+        uuid = api_fixture('container_requests')[cr_state]['uuid']
+        assert_select "div.dashboard-panel-info-row.row-#{uuid}" do
+          assert_select 'div.progress', should_show
+        end
+      end
+    end
+  end
+
   test "visit a public project and verify the public projects page link exists" do
     Rails.configuration.anonymous_user_token = api_fixture('api_client_authorizations')['anonymous']['api_token']
     uuid = api_fixture('groups')['anonymously_accessible_project']['uuid']
index 49a1faec3f726fcf7322b664410cfe2e02431e6a..f22cc3fbcbbe1f592db95d52cb1e36c80ef47a15 100644 (file)
@@ -4,9 +4,9 @@ queued:
   name: queued
   state: Committed
   priority: 1
-  created_at: 2016-01-11 11:11:11.111111111 Z
-  updated_at: 2016-01-11 11:11:11.111111111 Z
-  modified_at: 2016-01-11 11:11:11.111111111 Z
+  created_at: <%= 2.minute.ago.to_s(:db) %>
+  updated_at: <%= 1.minute.ago.to_s(:db) %>
+  modified_at: <%= 1.minute.ago.to_s(:db) %>
   modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
   container_image: test
   cwd: test
@@ -23,9 +23,9 @@ running:
   name: running
   state: Committed
   priority: 1
-  created_at: 2016-01-11 11:11:11.111111111 Z
-  updated_at: 2016-01-11 11:11:11.111111111 Z
-  modified_at: 2016-01-11 11:11:11.111111111 Z
+  created_at: <%= 2.minute.ago.to_s(:db) %>
+  updated_at: <%= 1.minute.ago.to_s(:db) %>
+  modified_at: <%= 1.minute.ago.to_s(:db) %>
   modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
   container_image: test
   cwd: test
@@ -193,9 +193,9 @@ uncommitted:
   uuid: zzzzz-xvhdp-cr4uncommittedc
   owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
   name: uncommitted
-  created_at: 2016-01-11 11:11:11.111111111 Z
-  updated_at: 2016-01-11 11:11:11.111111111 Z
-  modified_at: 2016-01-11 11:11:11.111111111 Z
+  created_at: <%= 2.minute.ago.to_s(:db) %>
+  updated_at: <%= 1.minute.ago.to_s(:db) %>
+  modified_at: <%= 1.minute.ago.to_s(:db) %>
   modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
   command: ["arvados-cwl-runner", "--local", "--api=containers",
             "/var/lib/cwl/workflow.json", "/var/lib/cwl/cwl.input.json"]