0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/plugins/discourse-ai/spec/system/admin_dashboard_spec.rb
Krzysztof Kotlarek f6727e03b6
DEV: Promote dashboard_improvements upcoming change to beta (#42116)
`promote_upcoming_changes_on_status` defaults to `beta`, so promoting
the change makes the redesigned dashboard the default everywhere,
including in the test environment.

Specs covering the legacy dashboard now opt out explicitly with
`SiteSetting.dashboard_improvements = false`.
2026-07-29 12:09:26 +08:00

36 lines
820 B
Ruby
Vendored

# frozen_string_literal: true
RSpec.describe "Admin dashboard" do
fab!(:admin)
before do
enable_current_plugin
SiteSetting.dashboard_improvements = false
end
it "displays the sentiment dashboard" do
SiteSetting.ai_sentiment_enabled = true
sign_in(admin)
visit "/admin/dashboard/sentiment"
expect(page).to have_css(".section.sentiment")
end
it "displays the emotion table with links" do
SiteSetting.ai_sentiment_enabled = true
Fabricate(
:sentiment_classification,
target: Fabricate(:post),
model_used: "SamLowe/roberta-base-go_emotions",
classification: {
love: 0.95,
},
)
sign_in(admin)
visit "/admin/dashboard/sentiment"
expect(page).to have_css(".admin-report.emotion-love .cell.value.today-count a")
end
end