Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit b88b520

Browse files
DEV: Fix specs and lint
1 parent f5baa25 commit b88b520

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

assets/javascripts/discourse/components/ai-llms-list-editor.gjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { action } from "@ember/object";
44
import { LinkTo } from "@ember/routing";
55
import { service } from "@ember/service";
66
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
7-
import icon from "discourse-common/helpers/d-icon";
87
import i18n from "discourse-common/helpers/i18n";
98
import I18n from "discourse-i18n";
109
import AdminPageSubheader from "admin/components/admin-page-subheader";
@@ -168,7 +167,7 @@ export default class AiLlmsListEditor extends Component {
168167
<td class="d-admin-row__controls">
169168
<LinkTo
170169
@route="adminPlugins.show.discourse-ai-llms.show"
171-
class="btn btn-default btn-small"
170+
class="btn btn-default btn-small ai-llm-list__edit-button"
172171
@model={{llm.id}}
173172
>
174173
<div class="d-button-label">

assets/javascripts/discourse/components/ai-persona-list-editor.gjs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import Component from "@glimmer/component";
2-
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
3-
import { tracked } from "@glimmer/tracking";
42
import { fn } from "@ember/helper";
53
import { on } from "@ember/modifier";
64
import { action } from "@ember/object";
@@ -10,9 +8,8 @@ import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
108
import DToggleSwitch from "discourse/components/d-toggle-switch";
119
import concatClass from "discourse/helpers/concat-class";
1210
import { popupAjaxError } from "discourse/lib/ajax-error";
13-
import { cook } from "discourse/lib/text";
1411
import i18n from "discourse-common/helpers/i18n";
15-
import I18n from "discourse-i18n";
12+
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
1613
import AdminPageSubheader from "admin/components/admin-page-subheader";
1714
import AiPersonaEditor from "./ai-persona-editor";
1815

@@ -108,7 +105,7 @@ export default class AiPersonaListEditor extends Component {
108105
<AdminConfigAreaEmptyList
109106
@ctaLabel="discourse_ai.ai_persona.new"
110107
@ctaRoute="adminPlugins.show.discourse-ai-personas.new"
111-
@ctaClass="ai-persona-list-editor__new-button"
108+
@ctaClass="ai-persona-list-editor__empty-new-button"
112109
@emptyLabel="discourse_ai.ai_persona.no_personas"
113110
/>
114111
{{/if}}

assets/javascripts/discourse/components/ai-tool-list-editor.gjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import Component from "@glimmer/component";
2-
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
32
import { LinkTo } from "@ember/routing";
43
import { service } from "@ember/service";
54
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
65
import i18n from "discourse-common/helpers/i18n";
76
import I18n from "discourse-i18n";
7+
import AdminConfigAreaEmptyList from "admin/components/admin-config-area-empty-list";
88
import AdminPageSubheader from "admin/components/admin-page-subheader";
99

1010
export default class AiToolListEditor extends Component {
@@ -73,7 +73,7 @@ export default class AiToolListEditor extends Component {
7373
<AdminConfigAreaEmptyList
7474
@ctaLabel="discourse_ai.tools.new"
7575
@ctaRoute="adminPlugins.show.discourse-ai-tools.new"
76-
@ctaClass="ai-tool-list-editor__new-button"
76+
@ctaClass="ai-tool-list-editor__empty-new-button"
7777
@emptyLabel="discourse_ai.tools.no_tools"
7878
/>
7979
{{/if}}

spec/system/admin_ai_persona_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
it "allows creation of a persona" do
1313
visit "/admin/plugins/discourse-ai/ai-personas"
14-
find(".ai-persona-list-editor__header .btn-primary").click()
14+
find(".ai-persona-list-editor__new-button").click()
1515
find(".ai-persona-editor__name").set("Test Persona")
1616
find(".ai-persona-editor__description").fill_in(with: "I am a test persona")
1717
find(".ai-persona-editor__system_prompt").fill_in(with: "You are a helpful bot")

spec/system/llms/ai_llm_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@
7676
it "shows the provider as CDCK in the UI" do
7777
visit "/admin/plugins/discourse-ai/ai-llms"
7878
expect(page).to have_css(
79-
"[data-llm-id='cdck-hosted'] .column-provider",
79+
"[data-llm-id='cdck-hosted']",
8080
text: I18n.t("js.discourse_ai.llms.providers.CDCK"),
8181
)
8282
end
8383

8484
it "shows an info alert to the user about the seeded LLM" do
8585
visit "/admin/plugins/discourse-ai/ai-llms"
86-
find("[data-llm-id='#{llm_model.name}'] .column-edit .btn").click()
86+
find("[data-llm-id='#{llm_model.name}'] .ai-llm-list__edit-button").click()
8787
expect(page).to have_css(
8888
".alert.alert-info",
8989
text: I18n.t("js.discourse_ai.llms.seeded_warning"),
@@ -92,7 +92,7 @@
9292

9393
it "limits and shows disabled inputs for the seeded LLM" do
9494
visit "/admin/plugins/discourse-ai/ai-llms"
95-
find("[data-llm-id='cdck-hosted'] .column-edit .btn").click()
95+
find("[data-llm-id='cdck-hosted'] .ai-llm-list__edit-button").click()
9696
expect(page).to have_css(".ai-llm-editor__display-name[disabled]")
9797
expect(page).to have_css(".ai-llm-editor__name[disabled]")
9898
expect(page).to have_css(".ai-llm-editor__provider.is-disabled")

0 commit comments

Comments
 (0)