mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-08 12:34:43 +00:00
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.
19 lines
801 B
Plaintext
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();
|
|
});
|
|
});
|