mirror of
https://github.com/zen-browser/www.git
synced 2025-07-07 17:05:32 +02:00
feat(prettier): add prettier formatting
This commit is contained in:
parent
01f4dac75d
commit
7fafa6bc69
85 changed files with 5670 additions and 2788 deletions
|
@ -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")
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue