diff --git a/src/lib/components/addons/AddOnListItem.svelte b/src/lib/components/addons/AddOnListItem.svelte index ba011a294..b0813f800 100644 --- a/src/lib/components/addons/AddOnListItem.svelte +++ b/src/lib/components/addons/AddOnListItem.svelte @@ -4,7 +4,6 @@ import { _ } from "svelte-i18n"; import AddOnPin from "@/addons/AddOnPin.svelte"; - import AddOnPopularity from "@/addons/Popularity.svelte"; import PremiumBadge from "@/premium-credits/PremiumBadge.svelte"; export let addon: AddOnListItem; @@ -35,11 +34,8 @@ >

{/if} - {#if addon.usage} - - {/if} {#if isPremium} - + {/if} diff --git a/src/lib/components/addons/tests/AddOnListItem.test.ts b/src/lib/components/addons/tests/AddOnListItem.test.ts new file mode 100644 index 000000000..1e11f79d4 --- /dev/null +++ b/src/lib/components/addons/tests/AddOnListItem.test.ts @@ -0,0 +1,11 @@ +import { test, expect } from "vitest"; +import { render } from "@testing-library/svelte"; +import AddOnListItem from "../AddOnListItem.svelte"; +import { addon, premiumAddon } from "@/test/fixtures/addons"; + +test("AddOnListItem", () => { + const result = render(AddOnListItem, { addon }); + expect(result.getByRole("heading")).toHaveTextContent(addon.name); + const premium = render(AddOnListItem, { addon: premiumAddon }); + expect(premium.getByRole("status")).toBeInTheDocument(); +});