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) { | |||
| 221 | 221 | } | |
| 222 | 222 | ||
| 223 | 223 | // First request should not be duplicate | |
| 224 | - | if dedup.IsDuplicate(req1) { | |
| 224 | + | if dedup.IsDuplicate(req1, false) { | |
| 225 | 225 | t.Error("first request should not be duplicate") | |
| 226 | 226 | } | |
| 227 | 227 | ||
| @@ -232,7 +232,7 @@ func TestRequestDeduplicator_DetectsDuplicates(t *testing.T) { | |||
| 232 | 232 | Timestamp: time.Now(), | |
| 233 | 233 | } | |
| 234 | 234 | ||
| 235 | - | if !dedup.IsDuplicate(req2) { | |
| 235 | + | if !dedup.IsDuplicate(req2, true) { | |
| 236 | 236 | t.Error("second identical request should be duplicate") | |
| 237 | 237 | } | |
| 238 | 238 | } | |
| @@ -253,10 +253,10 @@ func TestRequestDeduplicator_DifferentSourcesNotDuplicate(t *testing.T) { | |||
| 253 | 253 | Source: SourceMouse, | |
| 254 | 254 | } | |
| 255 | 255 | ||
| 256 | - | dedup.IsDuplicate(req1) | |
| 256 | + | dedup.IsDuplicate(req1, false) | |
| 257 | 257 | ||
| 258 | 258 | // Different source should not be duplicate | |
| 259 | - | if dedup.IsDuplicate(req2) { | |
| 259 | + | if dedup.IsDuplicate(req2, false) { | |
| 260 | 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 | 276 | // First request | |
| 277 | - | if dedup.IsDuplicate(req) { | |
| 277 | + | if dedup.IsDuplicate(req, false) { | |
| 278 | 278 | t.Error("first request should not be duplicate") | |
| 279 | 279 | } | |
| 280 | 280 | ||
| 281 | 281 | // Immediate duplicate | |
| 282 | - | if !dedup.IsDuplicate(req) { | |
| 282 | + | if !dedup.IsDuplicate(req, true) { | |
| 283 | 283 | t.Error("immediate duplicate should be detected") | |
| 284 | 284 | } | |
| 285 | 285 | ||
| @@ -287,7 +287,7 @@ func TestRequestDeduplicator_ExpiresOldSignatures(t *testing.T) { | |||
| 287 | 287 | time.Sleep(ttl + 10*time.Millisecond) | |
| 288 | 288 | ||
| 289 | 289 | // Should not be duplicate after expiration | |
| 290 | - | if dedup.IsDuplicate(req) { | |
| 290 | + | if dedup.IsDuplicate(req, false) { | |
| 291 | 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 | 312 | TargetNode: nodes[idx%len(nodes)], | |
| 313 | 313 | Source: SourceKeyboard, | |
| 314 | 314 | } | |
| 315 | - | _ = dedup.IsDuplicate(req) | |
| 315 | + | _ = dedup.IsDuplicate(req, false) | |
| 316 | 316 | time.Sleep(time.Microsecond) | |
| 317 | 317 | } | |
| 318 | 318 | }(i) | |
| @@ -221,7 +221,7 @@ func TestRequestDeduplicator_DetectsDuplicates(t *testing.T) { | |||||
| 221 | } | 221 | } | ||
| 222 | 222 | ||||
| 223 | // First request should not be duplicate | 223 | // 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 duplicate | 258 | // 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 request | 276 | // 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 duplicate | 281 | // 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 expiration | 289 | // 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) | ||