import asyncio
from textual.app import App
from tuiredis.screens.connect import ConnectScreen

class TestApp(App):
    SCREENS = {"connect": ConnectScreen}
    def on_mount(self):
        self.push_screen("connect")

async def test_save():
    app = TestApp()
    async with app.run_test(size=(120, 50)) as pilot:
        await pilot.pause(0.5)
        btn = app.screen.query_one("#save-btn")
        await pilot.click(btn)
        await pilot.pause(0.5)
        print("Save clicked successfully.")

if __name__ == "__main__":
    asyncio.run(test_save())
