refactor(webui): separate presentation views and expand component gallery (#6179)
* refactor(webui): organize shared components with an internal gallery * refactor(webui): decouple views and expand component gallery * fix(docker): include channel sources in WebUI build * refactor(webui): cover all channel interfaces in gallery * docs(webui): remove manual paragraph wrapping
This commit is contained in:
1 parent
db804ef94a
commit
30e43aec82
109 files changed
+7874
-3459
No files matched your search
@@ -5,6 +5,7 @@ import userEvent from "@testing-library/user-event";
|
||||
import { afterEach, beforeEach, expect, it, vi } from "vitest";
|
||||
|
||||
import { StarLink, StarPrompt } from "@/components/StarPrompt";
|
||||
import { StarPromptView } from "@/components/StarPromptView";
|
||||
import { starPromptAction } from "@/lib/api";
|
||||
import i18n from "@/i18n";
|
||||
import { supportedLocales } from "@/i18n/config";
|
||||
@@ -34,6 +35,18 @@ async function clickStarLink(link: HTMLElement) {
|
||||
await act(async () => fireEvent.click(link));
|
||||
}
|
||||
|
||||
it("renders an invitation from caller-owned state and delegates actions without claiming it", async () => {
|
||||
const star = vi.fn();
|
||||
const dismiss = vi.fn();
|
||||
render(<StarPromptView open saving={false} error={false} onOpenChange={vi.fn()}
|
||||
onStar={star} onDismissForever={dismiss} />);
|
||||
await clickStarLink(screen.getByRole("link", { name: "Star on GitHub" }));
|
||||
expect(star).toHaveBeenCalledTimes(1);
|
||||
await userEvent.click(screen.getByRole("button", { name: "Don't ask again" }));
|
||||
expect(dismiss).toHaveBeenCalledTimes(1);
|
||||
expect(action).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("claims once on entry and lets users skip without permanently dismissing", async () => {
|
||||
const view = render(<StarPrompt ready />);
|
||||
await enter();
|
||||
|
||||
Reference in new issue
Block a user