@@ -136,10 +136,9 @@ defmodule FieldHubWeb.ProjectShowLiveTest do
136
136
end
137
137
138
138
test "authorized user can see monitoring page" , % { conn: conn } do
139
- { :ok , view , html_on_mount } = live ( conn , "/ui/projects/show/#{ @ project } " )
139
+ { :ok , % { pid: pid } = view , html_on_mount } = live ( conn , "/ui/projects/show/#{ @ project } " )
140
140
141
- pid = view . pid
142
- :erlang . trace ( view . pid , true , [ :receive ] )
141
+ :erlang . trace ( pid , true , [ :receive ] )
143
142
144
143
assert html_on_mount =~ "<h1>Project <i>#{ @ project } </i></h1>"
145
144
assert html_on_mount =~ "No supervisor found in project document."
@@ -163,9 +162,7 @@ defmodule FieldHubWeb.ProjectShowLiveTest do
163
162
end
164
163
165
164
test "user can trigger issue evaluation" , % { conn: conn } do
166
- { :ok , view , _html_on_mount } = live ( conn , "/ui/projects/show/#{ @ project } " )
167
-
168
- pid = view . pid
165
+ { :ok , % { pid: pid } = view , _html_on_mount } = live ( conn , "/ui/projects/show/#{ @ project } " )
169
166
170
167
:erlang . trace ( pid , true , [ :receive ] )
171
168
@@ -416,12 +413,12 @@ defmodule FieldHubWeb.ProjectShowLiveTest do
416
413
end
417
414
418
415
test "file index cache can be deleted through the interface" , % { conn: conn } do
419
- { :ok , view , _html_on_mount } = live ( conn , "/ui/projects/show/#{ @ project } " )
416
+ { :ok , % { pid: pid } = view , _html_on_mount } = live ( conn , "/ui/projects/show/#{ @ project } " )
420
417
421
418
# We wait until the overview task has completed and the result is received by the view process, because the
422
419
# overview evaluation will create a cached index.
423
- :erlang . trace ( view . pid , true , [ :receive ] )
424
- assert_receive { :trace , _ , :receive , { _ref , { :overview_task , _stats } } }
420
+ :erlang . trace ( pid , true , [ :receive ] )
421
+ assert_receive { :trace , ^ pid , :receive , { _ref , { :overview_task , _stats } } }
425
422
426
423
assert { :ok , % { "o26" => _value } } = Cachex . get ( @ index_cache_name , @ project )
427
424
0 commit comments