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.
This commit is contained in:
taroj1205 2025-05-16 12:36:23 +12:00
parent 646fb03317
commit 14c88d32b3
No known key found for this signature in database
GPG key ID: 0FCB6CFFE0981AB7

View file

@ -71,8 +71,14 @@ describe('<PlatformDownload />', () => {
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('<PlatformDownload />', () => {
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')
})
})