Skip to content

Commit f61a435

Browse files
committed
tests: popups: Add test for content copied from About popup.
1 parent 6f9aea9 commit f61a435

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/ui_tools/test_popups.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@ def mock_external_classes(self, mocker: MockerFixture) -> None:
189189
)
190190
server_version, server_feature_level = MINIMUM_SUPPORTED_SERVER_VERSION
191191

192+
# FIXME: Since we don't test on WSL explicitly, for now
193+
# treat PLATFORM as WSL in order for it to be supported
194+
mocker.patch(MODULE + ".PLATFORM", "WSL")
195+
196+
mocker.patch(MODULE + ".detected_python_in_full", lambda: "[Python version]")
197+
192198
self.about_view = AboutView(
193199
self.controller,
194200
"About",
@@ -273,6 +279,26 @@ def test_categories(self) -> None:
273279
"Copy information to clipboard [c]",
274280
]
275281

282+
def test_copied_content(self) -> None:
283+
expected_output = f"""#### Application
284+
Zulip Terminal: {ZT_VERSION}
285+
286+
#### Server
287+
Version: {MINIMUM_SUPPORTED_SERVER_VERSION[0]}
288+
289+
#### Application Configuration
290+
Theme: zt_dark
291+
Autohide: disabled
292+
Maximum footlinks: 3
293+
Color depth: 256
294+
Notifications: disabled
295+
Exit confirmation: disabled
296+
297+
#### Detected Environment
298+
Platform: WSL
299+
Python: [Python version]"""
300+
assert self.about_view.copy_info == expected_output
301+
276302

277303
class TestUserInfoView:
278304
@pytest.fixture(autouse=True)

0 commit comments

Comments
 (0)