FIX: command selector behavior stopped working (#330)

When moving ai-command-selector from gjs to js the underlying
behavior changed, this corrects it and adds a test case.
This commit is contained in:
Sam 2023-12-02 14:20:26 +11:00 committed by GitHub
parent 3bc010b686
commit c8cd38cdda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -7,7 +7,7 @@ export default MultiSelectComponent.extend({
}),
content: computed(function () {
return this.commands.value;
return this.commands;
}),
value: "",

View File

@ -35,6 +35,11 @@ RSpec.describe "AI personas", type: :system, js: true do
find(".ai-persona-editor__name").set("Test Persona")
find(".ai-persona-editor__description").fill_in(with: "I am a test persona")
find(".ai-persona-editor__system_prompt").fill_in(with: "You are a helpful bot")
command_selector = PageObjects::Components::SelectKit.new(".ai-persona-editor__commands")
command_selector.expand
command_selector.select_row_by_value("ReadCommand")
find(".ai-persona-editor__save").click()
expect(page).not_to have_current_path("/admin/plugins/discourse-ai/ai_personas/new")
@ -45,6 +50,7 @@ RSpec.describe "AI personas", type: :system, js: true do
expect(persona.name).to eq("Test Persona")
expect(persona.description).to eq("I am a test persona")
expect(persona.system_prompt).to eq("You are a helpful bot")
expect(persona.commands).to eq(["ReadCommand"])
end
it "will not allow deletion or editing of system personas" do