This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +3
-34
lines changed
assets/javascripts/discourse Expand file tree Collapse file tree 4 files changed +3
-34
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export default class AiFeature extends RestModel {
99 "description" ,
1010 "enable_setting" ,
1111 "persona" ,
12- "persona_setting" ,
12+ "persona_setting"
1313 ) ;
1414 }
1515}
Original file line number Diff line number Diff line change 11import Component from " @glimmer/component" ;
2- import { action } from " @ember/object" ;
32import { service } from " @ember/service" ;
43import BackButton from " discourse/components/back-button" ;
5- import { popupAjaxError } from " discourse/lib/ajax-error" ;
6- import getURL from " discourse/lib/get-url" ;
74import SiteSettingComponent from " admin/components/site-setting" ;
85
96export default class AiFeatureEditor extends Component {
Original file line number Diff line number Diff line change 2929 expect ( response . parsed_body [ "name" ] ) . to eq ( I18n . t "discourse_ai.features.summarization.name" )
3030 end
3131 end
32-
33- describe "#update" do
34- before do
35- SiteSetting . ai_summarization_persona = summarizer_persona . id
36- SiteSetting . ai_summarization_enabled = true
37- end
38-
39- it "updates the feature" do
40- expect ( SiteSetting . ai_summarization_persona ) . to eq ( summarizer_persona . id . to_s )
41- expect ( SiteSetting . ai_summarization_enabled ) . to eq ( true )
42-
43- put "/admin/plugins/discourse-ai/ai-features/1.json" ,
44- params : {
45- ai_feature : {
46- enabled : false ,
47- persona_id : alternate_summarizer_persona . id ,
48- } ,
49- }
50-
51- expect ( SiteSetting . ai_summarization_persona ) . to eq ( alternate_summarizer_persona . id . to_s )
52- expect ( SiteSetting . ai_summarization_enabled ) . to eq ( false )
53- end
54- end
5532end
Original file line number Diff line number Diff line change 5050 expect ( page ) . to have_current_path ( "/admin/plugins" )
5151 end
5252
53- it "can edit the AI feature " do
53+ it "shows edit page with settings " do
5454 ai_features_page . visit
5555 ai_features_page . click_edit_feature ( I18n . t ( "discourse_ai.features.summarization.name" ) )
5656 expect ( page ) . to have_current_path ( "/admin/plugins/discourse-ai/ai-features/1/edit" )
5959 text : I18n . t ( "discourse_ai.features.summarization.name" ) ,
6060 )
6161
62- form . field ( "persona_id" ) . select ( -6 )
63- form . submit
64- expect ( page ) . to have_current_path ( "/admin/plugins/discourse-ai/ai-features" )
65- expect ( ai_features_page ) . to have_feature_persona (
66- I18n . t ( "discourse_ai.ai_bot.personas.creative.name" ) ,
67- )
62+ expect ( page ) . to have_css ( ".setting" )
6863 end
6964end
You can’t perform that action at this time.
0 commit comments