Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/e2e/hydration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const PAGES = [
'/compare',
'/search',
'/package/nuxt',
'/package-code/empathic/v/2.0.0',
'/search?q=vue',
] as const

Expand Down
28 changes: 28 additions & 0 deletions test/e2e/package-code.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { expect, test } from './test-utils'

test.describe('Package Code Viewer', () => {
test('/package-code/empathic/v/2.0.0 loads correctly', async ({ page, goto }) => {
await goto('/package-code/empathic/v/2.0.0', { waitUntil: 'domcontentloaded' })

// Verify page heading or package name container
await expect(page.locator('h1')).toContainText('empathic')

// Verify the specific version is rendered
await expect(
page.locator('[data-testid="version-selector-button"]').locator('text=2.0.0'),
).toBeVisible()

const codePage = page.locator('#code-page-container')

await expect(
codePage.locator('aside').getByRole('link', { name: 'package.json', exact: true }),
).toBeVisible()

const directoryListing = codePage.getByRole('table')
await expect(directoryListing).toBeVisible()

await expect(
directoryListing.locator('a[href="/package-code/empathic/v/2.0.0/package.json"]'),
).toBeVisible()
Comment thread
gameroman marked this conversation as resolved.
})
})
Loading