mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: dedicated admin section for new features (#24292)
New tab in admin panel with list of new features. Presentation was enhanced by screenshot and markdown description. Related PR https://github.com/discourse-org/discourse-new-features-feeds/pull/23
This commit is contained in:
committed by
GitHub
parent
abc0fad17e
commit
96c5a6c9ca
56
spec/system/admin_dashboard_new_features_spec.rb
Normal file
56
spec/system/admin_dashboard_new_features_spec.rb
Normal file
@@ -0,0 +1,56 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe "Admin Dashboard New Features Page", type: :system do
|
||||
let(:new_features_page) { PageObjects::Pages::AdminDashboardNewFeatures.new }
|
||||
fab!(:admin) { Fabricate(:admin) }
|
||||
|
||||
before { sign_in(admin) }
|
||||
|
||||
it "displays new features with screenshot taking precednce over emoji" 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",
|
||||
"screenshot_url" =>
|
||||
"/uploads/default/original/1X/bab053dc94dc4e0d357b0e777e3357bb1ac99e12.jpeg",
|
||||
},
|
||||
],
|
||||
)
|
||||
|
||||
new_features_page.visit
|
||||
expect(new_features_page).to have_screenshot
|
||||
expect(new_features_page).to have_learn_more_link
|
||||
expect(new_features_page).to have_no_emoji
|
||||
end
|
||||
|
||||
it "displays new features with emoji when no screenshot" 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_emoji
|
||||
expect(new_features_page).to have_no_screenshot
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,32 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Pages
|
||||
class AdminDashboardNewFeatures < PageObjects::Pages::Base
|
||||
def visit
|
||||
page.visit("/admin/dashboard/new-features")
|
||||
self
|
||||
end
|
||||
|
||||
def has_screenshot?
|
||||
page.has_css?(".admin-new-feature-item__screenshot")
|
||||
end
|
||||
|
||||
def has_no_screenshot?
|
||||
page.has_no_css?(".admin-new-feature-item__screenshot")
|
||||
end
|
||||
|
||||
def has_learn_more_link?
|
||||
page.has_css?(".admin-new-feature-item__learn-more")
|
||||
end
|
||||
|
||||
def has_emoji?
|
||||
page.has_css?(".admin-new-feature-item__new-feature-emoji")
|
||||
end
|
||||
|
||||
def has_no_emoji?
|
||||
page.has_no_css?(".admin-new-feature-item__new-feature-emoji")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user