detached 9f75a78

test(browser): fix IsDuplicate test calls with isActiveTarget parameter

Update all 8 test calls to IsDuplicate() to include the new isActiveTarget
boolean parameter that was added to the method signature. This parameter
determines whether duplicate detection should be enforced based on whether
the target pane is currently active.
commit
9f75a78bd336d2980642173ac171a5c584baeb5a
author
bamen · · 2025-10-09 19:54 UTC
committer
bamen · · 2025-10-09 21:27 UTC
parent
30663df
signature
unsigned
1 file · +8 -8
M internal/app/browser/focus_state_machine_test.go +8 -8
@@ -221,7 +221,7 @@ func TestRequestDeduplicator_DetectsDuplicates(t *testing.T) {
221221 }
222222
223223 // First request should not be duplicate
224- if dedup.IsDuplicate(req1) {
224+ if dedup.IsDuplicate(req1, false) {
225225 t.Error("first request should not be duplicate")
226226 }
227227
@@ -232,7 +232,7 @@ func TestRequestDeduplicator_DetectsDuplicates(t *testing.T) {
232232 Timestamp: time.Now(),
233233 }
234234
235- if !dedup.IsDuplicate(req2) {
235+ if !dedup.IsDuplicate(req2, true) {
236236 t.Error("second identical request should be duplicate")
237237 }
238238 }
@@ -253,10 +253,10 @@ func TestRequestDeduplicator_DifferentSourcesNotDuplicate(t *testing.T) {
253253 Source: SourceMouse,
254254 }
255255
256- dedup.IsDuplicate(req1)
256+ dedup.IsDuplicate(req1, false)
257257
258258 // Different source should not be duplicate
259- if dedup.IsDuplicate(req2) {
259+ if dedup.IsDuplicate(req2, false) {
260260 t.Error("requests with different sources should not be duplicates")
261261 }
262262 }
@@ -274,12 +274,12 @@ func TestRequestDeduplicator_ExpiresOldSignatures(t *testing.T) {
274274 }
275275
276276 // First request
277- if dedup.IsDuplicate(req) {
277+ if dedup.IsDuplicate(req, false) {
278278 t.Error("first request should not be duplicate")
279279 }
280280
281281 // Immediate duplicate
282- if !dedup.IsDuplicate(req) {
282+ if !dedup.IsDuplicate(req, true) {
283283 t.Error("immediate duplicate should be detected")
284284 }
285285
@@ -287,7 +287,7 @@ func TestRequestDeduplicator_ExpiresOldSignatures(t *testing.T) {
287287 time.Sleep(ttl + 10*time.Millisecond)
288288
289289 // Should not be duplicate after expiration
290- if dedup.IsDuplicate(req) {
290+ if dedup.IsDuplicate(req, false) {
291291 t.Error("request after TTL should not be duplicate")
292292 }
293293 }
@@ -312,7 +312,7 @@ func TestRequestDeduplicator_ConcurrentAccess(t *testing.T) {
312312 TargetNode: nodes[idx%len(nodes)],
313313 Source: SourceKeyboard,
314314 }
315- _ = dedup.IsDuplicate(req)
315+ _ = dedup.IsDuplicate(req, false)
316316 time.Sleep(time.Microsecond)
317317 }
318318 }(i)
@@ -221,7 +221,7 @@ func TestRequestDeduplicator_DetectsDuplicates(t *testing.T) {
221 }221 }
222 222
223 // First request should not be duplicate223 // First request should not be duplicate
224- if dedup.IsDuplicate(req1) {224+ if dedup.IsDuplicate(req1, false) {
225 t.Error("first request should not be duplicate")225 t.Error("first request should not be duplicate")
226 }226 }
227 227
@@ -232,7 +232,7 @@ func TestRequestDeduplicator_DetectsDuplicates(t *testing.T) {
232 Timestamp: time.Now(),232 Timestamp: time.Now(),
233 }233 }
234 234
235- if !dedup.IsDuplicate(req2) {235+ if !dedup.IsDuplicate(req2, true) {
236 t.Error("second identical request should be duplicate")236 t.Error("second identical request should be duplicate")
237 }237 }
238 }238 }
@@ -253,10 +253,10 @@ func TestRequestDeduplicator_DifferentSourcesNotDuplicate(t *testing.T) {
253 Source: SourceMouse,253 Source: SourceMouse,
254 }254 }
255 255
256- dedup.IsDuplicate(req1)256+ dedup.IsDuplicate(req1, false)
257 257
258 // Different source should not be duplicate258 // Different source should not be duplicate
259- if dedup.IsDuplicate(req2) {259+ if dedup.IsDuplicate(req2, false) {
260 t.Error("requests with different sources should not be duplicates")260 t.Error("requests with different sources should not be duplicates")
261 }261 }
262 }262 }
@@ -274,12 +274,12 @@ func TestRequestDeduplicator_ExpiresOldSignatures(t *testing.T) {
274 }274 }
275 275
276 // First request276 // First request
277- if dedup.IsDuplicate(req) {277+ if dedup.IsDuplicate(req, false) {
278 t.Error("first request should not be duplicate")278 t.Error("first request should not be duplicate")
279 }279 }
280 280
281 // Immediate duplicate281 // Immediate duplicate
282- if !dedup.IsDuplicate(req) {282+ if !dedup.IsDuplicate(req, true) {
283 t.Error("immediate duplicate should be detected")283 t.Error("immediate duplicate should be detected")
284 }284 }
285 285
@@ -287,7 +287,7 @@ func TestRequestDeduplicator_ExpiresOldSignatures(t *testing.T) {
287 time.Sleep(ttl + 10*time.Millisecond)287 time.Sleep(ttl + 10*time.Millisecond)
288 288
289 // Should not be duplicate after expiration289 // Should not be duplicate after expiration
290- if dedup.IsDuplicate(req) {290+ if dedup.IsDuplicate(req, false) {
291 t.Error("request after TTL should not be duplicate")291 t.Error("request after TTL should not be duplicate")
292 }292 }
293 }293 }
@@ -312,7 +312,7 @@ func TestRequestDeduplicator_ConcurrentAccess(t *testing.T) {
312 TargetNode: nodes[idx%len(nodes)],312 TargetNode: nodes[idx%len(nodes)],
313 Source: SourceKeyboard,313 Source: SourceKeyboard,
314 }314 }
315- _ = dedup.IsDuplicate(req)315+ _ = dedup.IsDuplicate(req, false)
316 time.Sleep(time.Microsecond)316 time.Sleep(time.Microsecond)
317 }317 }
318 }(i)318 }(i)

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close