test_middleware: Remove help related tests.

Help center is going to cutover to using starlight. We won't have that
help center running during our backend tests for now, that will be done
after cutover. Remove help related opengraph tests. We have replaced
instances from api_docs wherever possible, but for most of the cases, an
equivalent was not found in api_docs.

There is no api_docs file that starts with `{settings_tab` or an
admonition or `{start_tabs}` and thus we need to remove those tests.

test_settings_tab was not testing what it said it was testing,
deactivate-your-account.md did not start with `{settings_tab` anymore.
That was changed in 584124bb45.
This commit is contained in:
Shubham Padia
2025-08-08 10:18:08 +00:00
committed by Tim Abbott
parent 9ec15e99bd
commit 075809b93e

View File

@@ -84,57 +84,7 @@ class OpenGraphTest(ZulipTestCase):
for substring in not_in_description:
self.assertNotIn(substring, open_graph_description)
def test_admonition_and_link(self) -> None:
# restrict-wildcard-mentions starts with an {!admin-only.md!},
# and has a link in the first paragraph.
self.check_title_and_description(
"/help/restrict-wildcard-mentions",
"Restrict wildcard mentions | Zulip help center",
[
"Organization administrators can configure who is allowed to use wildcard mentions ",
"more than 15 participants. | This permission can be granted to any combination of roles, ",
],
[
"Restrict wildcard mentions",
"feature is only available",
"Related articles",
"DMs, mentions, and alerts",
],
)
def test_settings_tab(self) -> None:
# deactivate-your-account starts with {settings_tab|account-and-privacy}
self.check_title_and_description(
"/help/deactivate-your-account",
"Deactivate your account | Zulip help center",
[
"Deactivating your Zulip account in one organization will have no effect "
"on any other Zulip accounts you may have. | Once you deactivate your account"
],
["Approve by clicking", " ", "\n"],
)
def test_tabs(self) -> None:
# logging-out starts with {start_tabs}
self.check_title_and_description(
"/help/logging-out",
"Logging out | Zulip help center",
# Ideally we'd do something better here
[
"Your feedback helps us make Zulip better for everyone! Please contact us with"
" questions, suggestions, and feature requests."
],
["Click on the gear"],
)
def test_index_pages(self) -> None:
self.check_title_and_description(
"/help/",
"Zulip help center",
["Welcome to the Zulip"],
[],
)
self.check_title_and_description(
"/api/",
"Zulip API documentation",
@@ -144,14 +94,16 @@ class OpenGraphTest(ZulipTestCase):
"guide should help you find the API you need:"
)
],
[],
# This is added to maintain coverage for the not_in_description
# block since we might want to keep using that for future tests.
["No such article."],
)
def test_nonexistent_page(self) -> None:
self.check_title_and_description(
"/help/not-a-real-page",
"/api/not-a-real-page",
# Probably we should make this "Zulip Help Center"
"No such article. | Zulip help center",
"No such article. | Zulip API documentation",
[
"No such article.",
"Your feedback helps us make Zulip better for everyone! Please contact us",