From ac30673b980c594e63ce727ab1374fdd87b77837 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Thu, 19 Oct 2023 13:47:28 +0200 Subject: [PATCH] DEV: Fix `ember/no-settled-after-test-helper` (#24008) --- .../discourse/tests/acceptance/search-test.js | 9 +-------- .../tests/acceptance/sidebar-narrow-desktop-test.js | 4 +--- .../javascripts/discourse/tests/helpers/qunit-helpers.js | 1 - .../tests/integration/components/d-lightbox-test.js | 5 +---- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/app/assets/javascripts/discourse/tests/acceptance/search-test.js b/app/assets/javascripts/discourse/tests/acceptance/search-test.js index fe45eed2442..f579b60d624 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/search-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/search-test.js @@ -1,10 +1,4 @@ -import { - click, - fillIn, - settled, - triggerKeyEvent, - visit, -} from "@ember/test-helpers"; +import { click, fillIn, triggerKeyEvent, visit } from "@ember/test-helpers"; import { test } from "qunit"; import searchFixtures from "discourse/tests/fixtures/search-fixtures"; import { @@ -497,7 +491,6 @@ acceptance("Search - Authenticated", function (needs) { "href" ); await triggerKeyEvent(".search-menu", "keydown", "A"); - await settled(); assert.strictEqual( query("#reply-control textarea").value, diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-narrow-desktop-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-narrow-desktop-test.js index 99bd3a88d70..83904d83fca 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-narrow-desktop-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-narrow-desktop-test.js @@ -1,4 +1,4 @@ -import { click, settled, visit, waitFor } from "@ember/test-helpers"; +import { click, visit, waitFor } from "@ember/test-helpers"; import $ from "jquery"; import { test } from "qunit"; import { acceptance, exists } from "discourse/tests/helpers/qunit-helpers"; @@ -12,7 +12,6 @@ acceptance("Sidebar - Narrow Desktop", function (needs) { test("wide sidebar is changed to cloak when resize to narrow screen", async function (assert) { await visit("/"); - await settled(); assert.ok(exists("#d-sidebar"), "wide sidebar is displayed"); await click(".header-sidebar-toggle .btn"); @@ -53,7 +52,6 @@ acceptance("Sidebar - Narrow Desktop", function (needs) { test("transition from narrow screen to wide screen", async function (assert) { await visit("/"); - await settled(); const bodyElement = document.querySelector("body"); bodyElement.style.width = "767px"; diff --git a/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js b/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js index 349fa929e3e..35dfa484736 100644 --- a/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js +++ b/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js @@ -609,7 +609,6 @@ export async function emulateAutocomplete(inputSelector, text) { await triggerKeyEvent(inputSelector, "keydown", "Backspace"); await fillIn(inputSelector, text); await triggerKeyEvent(inputSelector, "keyup", "Backspace"); - await settled(); } // The order of attributes can vary in different browsers. When comparing diff --git a/app/assets/javascripts/discourse/tests/integration/components/d-lightbox-test.js b/app/assets/javascripts/discourse/tests/integration/components/d-lightbox-test.js index 68b7a058b4a..81a14044678 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/d-lightbox-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/d-lightbox-test.js @@ -1,4 +1,4 @@ -import { click, render, settled } from "@ember/test-helpers"; +import { click, render } from "@ember/test-helpers"; import { hbs } from "ember-cli-htmlbars"; import { module, test } from "qunit"; import { setupLightboxes } from "discourse/lib/lightbox"; @@ -34,8 +34,6 @@ module("Integration | Component | d-lightbox", function (hooks) { ); await click(lightboxedElement); - await settled(); - assert.dom(SELECTORS.LIGHTBOX_CONTAINER).hasClass("is-visible"); assert @@ -70,7 +68,6 @@ module("Integration | Component | d-lightbox", function (hooks) { assert.dom(SELECTORS.FOCUS_TRAP).exists(); await click(SELECTORS.CLOSE_BUTTON); - await settled(); assert.dom(SELECTORS.LIGHTBOX_CONTAINER).doesNotHaveClass("is-visible"); assert.dom(SELECTORS.LIGHTBOX_CONTENT).doesNotExist();