Skip to content

Commit ee13330

Browse files
committed
DEV: param-input-test: updates selectors with select-kit-helper
1 parent c52400d commit ee13330

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/javascripts/acceptance/param-input-test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { click, currentURL, fillIn, visit } from "@ember/test-helpers";
22
import { test } from "qunit";
33
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
4+
import selectKit from "discourse/tests/helpers/select-kit-helper";
45

56
acceptance("Data Explorer Plugin | Param Input", function (needs) {
67
needs.user();
@@ -390,13 +391,14 @@ acceptance("Data Explorer Plugin | Param Input", function (needs) {
390391

391392
test("nullable category_id param: puts params for the query into the url", async function (assert) {
392393
const selectedCategory = { id: "6", name: "support" };
394+
const catChooser = selectKit(".category-chooser");
393395

394396
await visit("/admin/plugins/explorer/queries/4");
395-
assert.dom(".select-kit-selected-name").hasText("(no category)");
397+
assert.strictEqual(catChooser.header().value(), null);
396398

397-
await click(".select-kit-selected-name");
398-
await click(".category-row.select-kit-row:first-of-type");
399-
assert.dom(".select-kit-selected-name").hasText(selectedCategory.name);
399+
await catChooser.expand();
400+
await catChooser.selectRowByIndex(0);
401+
assert.strictEqual(catChooser.header().label(), selectedCategory.name);
400402

401403
await click("form.query-run button");
402404

0 commit comments

Comments
 (0)