discourse-ai/test/javascripts/integration/components/ai-indicator-wave-test.gjs
Keegan George e666266473
DEV: Make indicator wave a reusable component (#807)
Previously we had some hardcoded markup with scss making a loading indicator wave. This code was being duplicated and used in both semantic search and summarization. We want to add the indicator wave to the AI helper diff modal as well and have the text flashing instead of the loading spinner. To ensure we do not repeat ourselves, in this PR we turn the summary indicator wave into a reusable template only component called: `AiIndicatorWave`. We then apply the usage of that component to semantic search, summarization, and the composer helper modal.
2024-09-18 09:53:54 -07:00

19 lines
801 B
Plaintext

import { render } from "@ember/test-helpers";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import AiIndicatorWave from "discourse/plugins/discourse-ai/discourse/components/ai-indicator-wave";
module("Integration | Component | ai-indicator-wave", function (hooks) {
setupRenderingTest(hooks);
test("it renders an indicator wave", async function (assert) {
await render(<template><AiIndicatorWave @loading={{true}} /></template>);
assert.dom(".ai-indicator-wave").exists();
});
test("it does not render the indicator wave when loading is false", async function (assert) {
await render(<template><AiIndicatorWave @loading={{false}} /></template>);
assert.dom(".ai-indicator-wave").doesNotExist();
});
});