mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-05 03:12:14 +00:00
fix(ui): degrade combobox loading spinner under reduced motion
This commit is contained in:
@@ -101,6 +101,24 @@ describe("Combobox", () => {
|
||||
expect(unselectedCheck).toHaveClass("scale-95", "opacity-0");
|
||||
});
|
||||
|
||||
it("degrades the loading spinner animation under reduced motion", async () => {
|
||||
// Given
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<Combobox options={options} placeholder="Select provider" loading />,
|
||||
);
|
||||
|
||||
// When
|
||||
await user.click(
|
||||
screen.getByRole("combobox", { name: /select provider/i }),
|
||||
);
|
||||
const content = document.querySelector("[data-slot='popover-content']");
|
||||
const spinner = content?.querySelector("svg");
|
||||
|
||||
// Then
|
||||
expect(spinner).toHaveClass("animate-spin", "motion-reduce:animate-none");
|
||||
});
|
||||
|
||||
it("opens with the shared Popover content motion contract", async () => {
|
||||
// Given
|
||||
const user = userEvent.setup();
|
||||
|
||||
@@ -139,7 +139,7 @@ export function Combobox({
|
||||
<CommandList className="minimal-scrollbar max-h-[400px]">
|
||||
{loading && (
|
||||
<div className="text-text-neutral-tertiary flex items-center gap-2 px-3 py-2 text-sm">
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
<Loader2 className="h-4 w-4 animate-spin motion-reduce:animate-none" />
|
||||
<span>{loadingMessage}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user