diff --git a/memory-bank/progress.md b/memory-bank/progress.md index 2d6dd99..11b70a2 100644 --- a/memory-bank/progress.md +++ b/memory-bank/progress.md @@ -78,7 +78,7 @@ - ✅ **Entry editing**: Complete inline editing for IP, hostnames, comments, and active status - ✅ **Search functionality**: Complete search/filter by hostname, IP address, or comment - ✅ **Undo/Redo**: Complete command pattern implementation with 43 comprehensive tests -- ❌ **Bulk operations**: Select and modify multiple entries (moved to Phase 6) +- ❌ ~~**Bulk operations**: Select and modify multiple entries (won't be implemented)~~ ### Phase 5: Advanced Features - ❌ **DNS resolution**: Resolve hostnames to IP addresses diff --git a/tests/test_main.py b/tests/test_main.py index f3389ed..810243d 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -267,6 +267,10 @@ class TestHostsManagerApp: ): app = HostsManagerApp() + # Mock the query_one method to avoid UI dependencies + mock_footer = Mock() + app.query_one = Mock(return_value=mock_footer) + # Add test entries app.hosts_file = HostsFile() app.hosts_file.add_entry( @@ -280,10 +284,12 @@ class TestHostsManagerApp: app.update_status() - # Verify sub_title was set correctly - assert "Read-only mode" in app.sub_title - assert "2 entries" in app.sub_title - assert "1 active" in app.sub_title + # Verify footer status was updated + mock_footer.set_status.assert_called_once() + status_call = mock_footer.set_status.call_args[0][0] + assert "Read-only" in status_call + assert "2 entries" in status_call + assert "1 active" in status_call def test_update_status_custom_message(self): """Test status bar update with custom message.""" @@ -299,9 +305,18 @@ class TestHostsManagerApp: # Mock set_timer and query_one to avoid event loop and UI issues app.set_timer = Mock() mock_status_bar = Mock() - app.query_one = Mock(return_value=mock_status_bar) + mock_footer = Mock() - # Add test hosts_file for subtitle generation + def mock_query_one(selector, widget_type=None): + if selector == "#status-bar": + return mock_status_bar + elif selector == "#custom-footer": + return mock_footer + return Mock() + + app.query_one = mock_query_one + + # Add test hosts_file for footer status generation app.hosts_file = HostsFile() app.hosts_file.add_entry( HostEntry(ip_address="127.0.0.1", hostnames=["localhost"]) @@ -317,9 +332,11 @@ class TestHostsManagerApp: # Verify status bar was updated with custom message mock_status_bar.update.assert_called_with("Custom status message") mock_status_bar.remove_class.assert_called_with("hidden") - # Verify subtitle shows current status (not the custom message) - assert "2 entries" in app.sub_title - assert "Read-only mode" in app.sub_title + # Verify footer status was updated with current status (not the custom message) + mock_footer.set_status.assert_called_once() + footer_status = mock_footer.set_status.call_args[0][0] + assert "2 entries" in footer_status + assert "Read-only" in footer_status # Verify timer was set for auto-clearing app.set_timer.assert_called_once()