FEATURE: allow admins to enable announced experimental features (#29244)

Toggle the button to enable the experimental site setting from "What's new" announcement.

The toggle button is displayed when:
- site setting exists and is boolean;
- potentially required plugin is enabled.
This commit is contained in:
Krzysztof Kotlarek
2024-10-22 10:56:58 +11:00
committed by GitHub
parent 644e6c7f46
commit 433fadbd52
12 changed files with 363 additions and 46 deletions

View File

@ -90,6 +90,28 @@ describe "Admin New Features Page", type: :system do
expect(new_features_page).to have_no_screenshot
end
it "displays experimental feature toggle" 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_toggle_experiment_button
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"