From 14c88d32b34ec18fbee25cefbaa6f452a31f0c05 Mon Sep 17 00:00:00 2001 From: taroj1205 Date: Fri, 16 May 2025 12:36:23 +1200 Subject: [PATCH] test(platform-download): add AppImage support and enhance Linux platform tests - Updated the test for the Linux platform to include AppImage download options for both x86_64 and ARM64 architectures. - Added assertions to verify the presence of AppImage links and checksums in the rendered output. - Ensured consistency in platform naming and improved test coverage for Linux releases. --- src/tests/components/PlatformDownload.test.ts | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/tests/components/PlatformDownload.test.ts b/src/tests/components/PlatformDownload.test.ts index 76afd81..ef74c82 100644 --- a/src/tests/components/PlatformDownload.test.ts +++ b/src/tests/components/PlatformDownload.test.ts @@ -71,8 +71,14 @@ describe('', () => { it('renders linux platform with all branches', async () => { const linuxReleases = { flathub: { all: { label: 'Flathub', link: '/flathub' } }, - x86_64: { tarball: { label: 'Tarball x86_64', link: '/tarball-x86_64', checksum: 'sha256' } }, - aarch64: { tarball: { label: 'Tarball ARM64', link: '/tarball-arm64', checksum: 'sha256-arm64' } }, + x86_64: { + tarball: { label: 'Tarball x86_64', link: '/tarball-x86_64', checksum: 'sha256' }, + appImage: { label: 'AppImage x86_64', link: '/appimage-x86_64', checksum: 'sha256-appimage' }, + }, + aarch64: { + tarball: { label: 'Tarball ARM64', link: '/tarball-arm64', checksum: 'sha256-arm64' }, + appImage: { label: 'AppImage ARM64', link: '/appimage-arm64', checksum: 'sha256-appimage-arm64' }, + }, } const result = await container.renderToString(PlatformDownload, { props: { @@ -83,6 +89,31 @@ describe('', () => { releases: linuxReleases, }, }) + + // Test basic content + expect(result).toContain('Linux Title') + expect(result).toContain('Linux Desc') + + // Test Flathub section + expect(result).toContain('Flathub') + 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') + expect(result).toContain('AppImage x86_64') + expect(result).toContain('/appimage-x86_64') + expect(result).toContain('sha256-appimage') + + // Test ARM64 section expect(result).toContain('ARM64') + expect(result).toContain('Tarball ARM64') + expect(result).toContain('/tarball-arm64') + expect(result).toContain('sha256-arm64') + expect(result).toContain('AppImage ARM64') + expect(result).toContain('/appimage-arm64') + expect(result).toContain('sha256-appimage-arm64') }) })