From 15cc33b8ccc3989b518a9a0a0f57709e87258327 Mon Sep 17 00:00:00 2001 From: jumagura Date: Mon, 17 Apr 2023 12:01:54 -0400 Subject: [PATCH] DEV: Update admin acceptance test `custom-fields`, `logs`, `submissions` --- test/javascripts/acceptance/admin-custom-fields-test.js | 2 +- test/javascripts/acceptance/admin-logs-test.js | 8 +++----- test/javascripts/acceptance/admin-submissions-test.js | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/test/javascripts/acceptance/admin-custom-fields-test.js b/test/javascripts/acceptance/admin-custom-fields-test.js index 52d594a0..9b02023d 100644 --- a/test/javascripts/acceptance/admin-custom-fields-test.js +++ b/test/javascripts/acceptance/admin-custom-fields-test.js @@ -4,7 +4,7 @@ import { visible, } from "discourse/tests/helpers/qunit-helpers"; import { test } from "qunit"; -import { findAll, visit } from "@ember/test-helpers"; +import { click, findAll, visit } from "@ember/test-helpers"; import { getCustomFields, getUnsubscribedAdminWizards, diff --git a/test/javascripts/acceptance/admin-logs-test.js b/test/javascripts/acceptance/admin-logs-test.js index a8eb1957..c888a55a 100644 --- a/test/javascripts/acceptance/admin-logs-test.js +++ b/test/javascripts/acceptance/admin-logs-test.js @@ -1,6 +1,6 @@ import { acceptance, query } from "discourse/tests/helpers/qunit-helpers"; import { test } from "qunit"; -import { findAll, visit } from "@ember/test-helpers"; +import { click, findAll, visit } from "@ember/test-helpers"; import selectKit from "discourse/tests/helpers/select-kit-helper"; import { getUnsubscribedAdminWizards, @@ -54,8 +54,7 @@ acceptance("Admin | Logs", function (needs) { assert.ok(find("table")); assert.ok(findAll("table tbody tr").length === 2, "Displays logs list"); - const refreshButton = find(".refresh.btn"); - await click(refreshButton); + await click(".refresh.btn"); assert.ok(find("table")); assert.ok( findAll("table tbody tr").length === 2, @@ -63,8 +62,7 @@ acceptance("Admin | Logs", function (needs) { ); await wizards.expand(); - const li = find('[data-name="Select a wizard"]'); - await click(li); + await click('[data-name="Select a wizard"]'); const wizardContainerDiv = find(".admin-wizard-container"); assert.ok(wizardContainerDiv.children().length === 0, "the div is empty"); }); diff --git a/test/javascripts/acceptance/admin-submissions-test.js b/test/javascripts/acceptance/admin-submissions-test.js index cb602b2e..a12b3122 100644 --- a/test/javascripts/acceptance/admin-submissions-test.js +++ b/test/javascripts/acceptance/admin-submissions-test.js @@ -1,6 +1,6 @@ import { acceptance, query } from "discourse/tests/helpers/qunit-helpers"; import { test } from "qunit"; -import { findAll, visit } from "@ember/test-helpers"; +import { click, findAll, visit } from "@ember/test-helpers"; import selectKit from "discourse/tests/helpers/select-kit-helper"; import { getUnsubscribedAdminWizards, @@ -58,8 +58,7 @@ acceptance("Admin | Submissions", function (needs) { ); await wizards.expand(); - const li = find('[data-name="Select a wizard"]'); - await click(li); + await click('[data-name="Select a wizard"]'); const wizardContainerDiv = find(".admin-wizard-container"); assert.ok(wizardContainerDiv.children().length === 0, "the div is empty"); });