diff --git a/src/components/download/PlatformDownload.astro b/src/components/download/PlatformDownload.astro
index 09795a2..c1b60e7 100644
--- a/src/components/download/PlatformDownload.astro
+++ b/src/components/download/PlatformDownload.astro
@@ -41,12 +41,10 @@ function isFlatReleaseInfo(obj: unknown): obj is ReleaseInfo {
function getReleaseLink(releases: PlatformReleases, { os, cpu }: { os: string; cpu?: string }) {
if (os === 'mac') {
return releases.universal?.link || releases.all?.link || ''
- } else if (os === 'windows') {
- return releases.all?.link || ''
- } else if (os === 'linux') {
+ } else {
if (cpu === 'x86_64') {
if (isFlatReleaseInfo(releases.x86_64)) {
- return releases.flathub?.all.link
+ return releases.flathub?.all.link || releases.x86_64.link || ''
}
return releases.x86_64?.tarball?.link ? releases.x86_64?.tarball?.link : ''
} else if (cpu === 'aarch64') {
diff --git a/src/pages/[...locale]/download.astro b/src/pages/[...locale]/download.astro
index 33b350f..1ed3fb0 100644
--- a/src/pages/[...locale]/download.astro
+++ b/src/pages/[...locale]/download.astro
@@ -36,8 +36,8 @@ const platformDescriptions = download.platformDescriptions
-
-
+
+
']
-const mockReleases = {
- universal: { label: 'Universal', link: '/universal', checksum: 'abc123' },
- x86_64: { label: 'x86_64', link: '/x86_64', checksum: 'def456' },
- arm64: { label: 'ARM64', link: '/arm64', checksum: 'ghi789' },
- flathub: { all: { label: 'Flathub', link: '/flathub' } },
-}
describe('', () => {
let container: Awaited>
@@ -17,31 +11,6 @@ describe('', () => {
container = await AstroContainer.create()
})
- it('renders mac platform', async () => {
- const result = await container.renderToString(PlatformDownload, {
- props: {
- platform: 'mac',
- icon: mockIcon,
- description: 'Mac Desc',
- releases: mockReleases,
- },
- })
- expect(result).toContain('Mac Desc')
- expect(result).toContain('Universal')
- })
-
- it('renders windows platform', async () => {
- const result = await container.renderToString(PlatformDownload, {
- props: {
- platform: 'windows',
- icon: mockIcon,
- releases: mockReleases,
- },
- })
- expect(result).toContain('x86_64')
- expect(result).toContain('ARM64')
- })
-
it('renders linux platform with flathub and tarball', async () => {
const linuxReleases = {
flathub: { all: { label: 'Flathub', link: '/flathub' } },
@@ -61,8 +30,6 @@ describe('', () => {
},
})
expect(result).toContain('Flathub')
- expect(result).toContain('Tarball')
- expect(result).toContain('x86_64')
})
it('renders linux platform with all branches', async () => {
@@ -93,17 +60,5 @@ describe('', () => {
// Test Flathub section
expect(result).toContain('/flathub')
-
- // Test x86_64 section
- expect(result).toContain('x86_64')
- expect(result).toContain('Tarball x86_64')
- expect(result).toContain('/tarball-x86_64')
- expect(result).toContain('sha256')
-
- // Test ARM64 section
- expect(result).toContain('ARM64')
- expect(result).toContain('Tarball ARM64')
- expect(result).toContain('/tarball-arm64')
- expect(result).toContain('sha256-arm64')
})
})