@@ -161,12 +161,13 @@ class TimerManagementTest < ApplicationSystemTestCase
161161 assert_text I18n . t ( 'timer_sessions.timer.share_copied' )
162162 end
163163
164- test 'share button not visible when timer is active' do
165- FactoryBot . create ( :timer_session , finished : false , user : User . current )
164+ test 'share button is visible when timer is active' do
165+ FactoryBot . create ( :timer_session , :with_issues , finished : false , user : User . current )
166166 visit timer_sessions_path
167167
168168 assert has_content? ( I18n . t ( 'timer_sessions.timer.stop' ) )
169- assert_no_selector ( '[data-name="timer-share"]' )
169+ find ( '[data-name="timer-share"]' , wait : 5 ) . click
170+ assert_text I18n . t ( 'timer_sessions.timer.share_copied' )
170171 end
171172
172173 test 'shows only ignored notice when active session exists and url has params' do
@@ -184,6 +185,22 @@ class TimerManagementTest < ApplicationSystemTestCase
184185 assert_no_text I18n . t ( 'timer_sessions.timer.share_ignored' )
185186 end
186187
188+ test 'clears share query params from URL after prefilling' do
189+ visit timer_sessions_path (
190+ comments : 'Sprint planning' ,
191+ timer_start : '01.01.2026 09:00' ,
192+ timer_end : '01.01.2026 10:00'
193+ )
194+
195+ assert_text I18n . t ( 'timer_sessions.timer.share_prefilled' )
196+ assert_equal 'Sprint planning' , find ( '#timer_session_comments' ) . value
197+
198+ current_url = page . current_url
199+ assert_not current_url . include? ( 'comments=' ) , 'URL should not contain comments param'
200+ assert_not current_url . include? ( 'timer_start=' ) , 'URL should not contain timer_start param'
201+ assert_not current_url . include? ( 'timer_end=' ) , 'URL should not contain timer_end param'
202+ end
203+
187204 test 'preserves filter parameters when stopping a timer' do
188205 filter_date = 1 . week . ago . strftime ( '%Y-%m-%d' )
189206 current_date = Date . today . strftime ( '%Y-%m-%d' )
0 commit comments