DEV: Fix home-logo test flakes (#27135)

This commit is contained in:
Jarek Radosz 2024-05-22 17:49:04 +02:00 committed by GitHub
parent 24d701f058
commit 4c10b2eb33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -2,11 +2,12 @@ import { getOwner } from "@ember/application";
import { render } from "@ember/test-helpers";
import { module, test } from "qunit";
import HomeLogo, {
clearHomeLogoHrefCallback,
clearHomeLogoHrefCallback as clearComponentHomeLogoHrefCallback,
} from "discourse/components/header/home-logo";
import { withPluginApi } from "discourse/lib/plugin-api";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import { query } from "discourse/tests/helpers/qunit-helpers";
import { clearHomeLogoHrefCallback as clearWidgetHomeLogoHrefCallback } from "discourse/widgets/home-logo";
const bigLogo = "/images/d-logo-sketch.png?test";
const smallLogo = "/images/d-logo-sketch-small.png?test";
@ -22,7 +23,8 @@ module("Integration | Component | home-logo", function (hooks) {
this.session = getOwner(this).lookup("service:session");
this.session.set("darkModeAvailable", null);
this.session.set("defaultColorSchemeIsDark", null);
clearHomeLogoHrefCallback();
clearWidgetHomeLogoHrefCallback();
clearComponentHomeLogoHrefCallback();
});
test("basics", async function (assert) {

View File

@ -2,11 +2,12 @@
import { getOwner } from "@ember/application";
import { render } from "@ember/test-helpers";
import { module, test } from "qunit";
import { clearHomeLogoHrefCallback as clearComponentHomeLogoHrefCallback } from "discourse/components/header/home-logo";
import MountWidget from "discourse/components/mount-widget";
import { withPluginApi } from "discourse/lib/plugin-api";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import { count, exists, query } from "discourse/tests/helpers/qunit-helpers";
import { clearHomeLogoHrefCallback } from "discourse/widgets/home-logo";
import { clearHomeLogoHrefCallback as clearWidgetHomeLogoHrefCallback } from "discourse/widgets/home-logo";
const bigLogo = "/images/d-logo-sketch.png?test";
const smallLogo = "/images/d-logo-sketch-small.png?test";
@ -22,7 +23,8 @@ module("Integration | Component | Widget | home-logo", function (hooks) {
this.session = getOwner(this).lookup("service:session");
this.session.set("darkModeAvailable", null);
this.session.set("defaultColorSchemeIsDark", null);
clearHomeLogoHrefCallback();
clearWidgetHomeLogoHrefCallback();
clearComponentHomeLogoHrefCallback();
});
test("basics", async function (assert) {