diff --git a/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-default-toast-test.js b/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-default-toast-test.js index d1ce6dcf04b..c3bdc79fc51 100644 --- a/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-default-toast-test.js +++ b/app/assets/javascripts/discourse/tests/integration/components/float-kit/d-default-toast-test.js @@ -25,6 +25,27 @@ module( assert.dom(".fk-d-default-toast__icon-container").doesNotExist(); }); + test("progress bar", async function (assert) { + this.toast = new DToastInstance(this, {}); + this.noop = () => {}; + + await render( + hbs`` + ); + + assert.dom(".fk-d-default-toast__progress-bar").exists(); + }); + + test("no progress bar", async function (assert) { + this.toast = new DToastInstance(this, {}); + + await render( + hbs`` + ); + + assert.dom(".fk-d-default-toast__progress-bar").doesNotExist(); + }); + test("title", async function (assert) { this.toast = new DToastInstance(this, { data: { title: "Title" } }); diff --git a/app/assets/javascripts/float-kit/addon/components/d-default-toast.gjs b/app/assets/javascripts/float-kit/addon/components/d-default-toast.gjs index 1ca910d91a1..660c10d9326 100644 --- a/app/assets/javascripts/float-kit/addon/components/d-default-toast.gjs +++ b/app/assets/javascripts/float-kit/addon/components/d-default-toast.gjs @@ -1,4 +1,5 @@ import { concat, fn, hash } from "@ember/helper"; +import didInsert from "@ember/render-modifiers/modifiers/did-insert"; import { or } from "truth-helpers"; import DButton from "discourse/components/d-button"; import concatClass from "discourse/helpers/concat-class"; @@ -12,6 +13,12 @@ const DDefaultToast =