feat(prettier): add prettier formatting

This commit is contained in:
Shintaro Jokagi 2025-05-28 13:43:44 +12:00
parent 01f4dac75d
commit 7fafa6bc69
No known key found for this signature in database
GPG key ID: 0DDF8FA44C9A0DA8
85 changed files with 5670 additions and 2788 deletions

View file

@ -1,47 +1,48 @@
import { experimental_AstroContainer as AstroContainer } from 'astro/container'
import { beforeEach, describe, expect, it } from 'vitest'
import ButtonCard from '~/components/download/ButtonCard.astro'
import { experimental_AstroContainer as AstroContainer } from "astro/container"
import { beforeEach, describe, expect, it } from "vitest"
describe('<ButtonCard />', () => {
import ButtonCard from "~/components/download/ButtonCard.astro"
describe("<ButtonCard />", () => {
let container: Awaited<ReturnType<typeof AstroContainer.create>>
beforeEach(async () => {
container = await AstroContainer.create()
})
it('renders with required props', async () => {
it("renders with required props", async () => {
const result = await container.renderToString(ButtonCard, {
props: {
label: 'Download',
href: '/download',
label: "Download",
href: "/download",
},
})
expect(result).toContain('Download')
expect(result).toContain("Download")
expect(result).toContain('href="/download"')
expect(result).not.toContain('Show SHA-256')
expect(result).not.toContain("Show SHA-256")
})
it('renders with checksum', async () => {
it("renders with checksum", async () => {
const result = await container.renderToString(ButtonCard, {
props: {
label: 'Download',
href: '/download',
checksum: 'sha256sum',
label: "Download",
href: "/download",
checksum: "sha256sum",
},
})
expect(result).toContain('Show SHA-256')
expect(result).toContain('sha256sum')
expect(result).toContain('Copy')
expect(result).toContain("Show SHA-256")
expect(result).toContain("sha256sum")
expect(result).toContain("Copy")
})
it('renders with variant', async () => {
it("renders with variant", async () => {
const result = await container.renderToString(ButtonCard, {
props: {
label: 'Download',
href: '/download',
variant: 'flathub',
label: "Download",
href: "/download",
variant: "flathub",
},
})
expect(result).toContain('Download')
expect(result).toContain('Beta')
expect(result).toContain("Download")
expect(result).toContain("Beta")
})
})