UX: New experimental features should be marked clearly (#29622)

This PR adds a small visual change to the new feature item on the `/admin/whats-new` page. When features are marked with an experimental site setting, they should show an indication on the feature item that it is "Experimental"
This commit is contained in:
Keegan George
2024-11-07 08:26:30 +09:00
committed by GitHub
parent 39198afa49
commit fad0d2ec62
6 changed files with 70 additions and 0 deletions

View File

@ -112,6 +112,49 @@ describe "Admin New Features Page", type: :system do
expect(new_features_page).to have_toggle_experiment_button
end
it "displays experimental text next to feature title when feature is experimental" do
DiscourseUpdates.stubs(:new_features).returns(
[
{
"id" => 7,
"user_id" => 1,
"emoji" => "😍",
"title" => "New feature",
"description" => "New feature description",
"link" => "https://meta.discourse.org",
"tier" => [],
"discourse_version" => "",
"created_at" => "2023-11-10T02:52:41.462Z",
"updated_at" => "2023-11-10T04:28:47.020Z",
"experiment_setting" => "experimental_form_templates",
},
],
)
new_features_page.visit
expect(new_features_page).to have_experimental_text
end
it "does not display experimental text next to feature title when feature is not experimental" do
DiscourseUpdates.stubs(:new_features).returns(
[
{
"id" => 7,
"user_id" => 1,
"emoji" => "😍",
"title" => "New feature",
"description" => "New feature description",
"link" => "https://meta.discourse.org",
"tier" => [],
"discourse_version" => "",
"created_at" => "2023-11-10T02:52:41.462Z",
"updated_at" => "2023-11-10T04:28:47.020Z",
},
],
)
new_features_page.visit
expect(new_features_page).to have_no_experimental_text
end
it "displays a new feature indicator on the sidebar and clears it when navigating to what's new" do
DiscourseUpdates.stubs(:has_unseen_features?).returns(true)
visit "/admin"