@@ -12,13 +12,13 @@ import (
1212func TestMenuChangeDetection (t * testing.T ) {
1313 // Create app with test data
1414 app := & App {
15- mu : sync.RWMutex {},
16- stateManager : NewPRStateManager (time .Now ()),
17- hiddenOrgs : make (map [string ]bool ),
18- seenOrgs : make (map [string ]bool ),
19- blockedPRTimes : make (map [string ]time.Time ),
20- browserRateLimiter : NewBrowserRateLimiter (30 * time .Second , 5 , defaultMaxBrowserOpensDay ),
21- systrayInterface : & MockSystray {},
15+ mu : sync.RWMutex {},
16+ stateManager : NewPRStateManager (time .Now ()),
17+ hiddenOrgs : make (map [string ]bool ),
18+ seenOrgs : make (map [string ]bool ),
19+ blockedPRTimes : make (map [string ]time.Time ),
20+ browserRateLimiter : NewBrowserRateLimiter (30 * time .Second , 5 , defaultMaxBrowserOpensDay ),
21+ systrayInterface : & MockSystray {},
2222 incoming : []PR {
2323 {Repository : "org1/repo1" , Number : 1 , Title : "Fix bug" , URL : "https://github.com/org1/repo1/pull/1" , NeedsReview : true , UpdatedAt : time .Now ()},
2424 {Repository : "org2/repo2" , Number : 2 , Title : "Add feature" , URL : "https://github.com/org2/repo2/pull/2" , NeedsReview : false , UpdatedAt : time .Now ()},
@@ -105,15 +105,15 @@ func TestMenuChangeDetection(t *testing.T) {
105105func TestFirstRunMenuRebuildBug (t * testing.T ) {
106106 // Create app simulating initial state
107107 app := & App {
108- mu : sync.RWMutex {},
109- stateManager : NewPRStateManager (time .Now ()),
110- hiddenOrgs : make (map [string ]bool ),
111- seenOrgs : make (map [string ]bool ),
112- blockedPRTimes : make (map [string ]time.Time ),
113- browserRateLimiter : NewBrowserRateLimiter (30 * time .Second , 5 , defaultMaxBrowserOpensDay ),
114- menuInitialized : false ,
115- systrayInterface : & MockSystray {},
116- lastMenuTitles : nil , // This is nil on first run - the bug condition
108+ mu : sync.RWMutex {},
109+ stateManager : NewPRStateManager (time .Now ()),
110+ hiddenOrgs : make (map [string ]bool ),
111+ seenOrgs : make (map [string ]bool ),
112+ blockedPRTimes : make (map [string ]time.Time ),
113+ browserRateLimiter : NewBrowserRateLimiter (30 * time .Second , 5 , defaultMaxBrowserOpensDay ),
114+ menuInitialized : false ,
115+ systrayInterface : & MockSystray {},
116+ lastMenuTitles : nil , // This is nil on first run - the bug condition
117117 incoming : []PR {
118118 {Repository : "test/repo" , Number : 1 , Title : "Test PR" , URL : "https://github.com/test/repo/pull/1" },
119119 },
@@ -148,7 +148,7 @@ func TestFirstRunMenuRebuildBug(t *testing.T) {
148148
149149 // Test 2: Current and stored titles should be equal (no changes)
150150 if ! slices .Equal (currentTitles , storedTitles ) {
151- t .Errorf ("BUG: Titles marked as different when they're the same:\n Current: %v\n Stored: %v" ,
151+ t .Errorf ("BUG: Titles marked as different when they're the same:\n Current: %v\n Stored: %v" ,
152152 currentTitles , storedTitles )
153153 }
154154
@@ -164,13 +164,13 @@ func TestFirstRunMenuRebuildBug(t *testing.T) {
164164// TestHiddenOrgChangesMenu tests that hiding/showing orgs updates menu titles
165165func TestHiddenOrgChangesMenu (t * testing.T ) {
166166 app := & App {
167- mu : sync.RWMutex {},
168- stateManager : NewPRStateManager (time .Now ()),
169- hiddenOrgs : make (map [string ]bool ),
170- seenOrgs : make (map [string ]bool ),
171- blockedPRTimes : make (map [string ]time.Time ),
172- browserRateLimiter : NewBrowserRateLimiter (30 * time .Second , 5 , defaultMaxBrowserOpensDay ),
173- systrayInterface : & MockSystray {},
167+ mu : sync.RWMutex {},
168+ stateManager : NewPRStateManager (time .Now ()),
169+ hiddenOrgs : make (map [string ]bool ),
170+ seenOrgs : make (map [string ]bool ),
171+ blockedPRTimes : make (map [string ]time.Time ),
172+ browserRateLimiter : NewBrowserRateLimiter (30 * time .Second , 5 , defaultMaxBrowserOpensDay ),
173+ systrayInterface : & MockSystray {},
174174 incoming : []PR {
175175 {Repository : "org1/repo1" , Number : 1 , Title : "PR 1" , URL : "https://github.com/org1/repo1/pull/1" },
176176 {Repository : "org2/repo2" , Number : 2 , Title : "PR 2" , URL : "https://github.com/org2/repo2/pull/2" },
@@ -186,15 +186,15 @@ func TestHiddenOrgChangesMenu(t *testing.T) {
186186
187187 // Generate new titles - should have fewer items
188188 newTitles := app .generateMenuTitles ()
189-
189+
190190 // Titles should be different
191191 if slices .Equal (initialTitles , newTitles ) {
192192 t .Error ("Hiding an org didn't change menu titles" )
193193 }
194194
195195 // Should have fewer items (org1/repo1 should be hidden)
196196 if len (newTitles ) >= initialCount {
197- t .Errorf ("Menu should have fewer items after hiding org: got %d, started with %d" ,
197+ t .Errorf ("Menu should have fewer items after hiding org: got %d, started with %d" ,
198198 len (newTitles ), initialCount )
199199 }
200- }
200+ }
0 commit comments