mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 14:18:17 +00:00
Add six domain-level web app e2e tests covering team member removal, file upload/delete/restore, share link creation and password protection, and collection creation. Introduce a parametrized 'file' fixture with configurable media types (text/binary/image/video/pdf) for future type-scoped tests, plus helpers for share APIs and team member seeding. Also document all web app e2e test cases in apps/web/e2e/README.md and require this documentation in AGENTS.md.
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { expect, test } from '../../fixtures'
|
|
import { fileCard } from '../../helpers/files'
|
|
|
|
test('owner creates a collection from the sidebar and the collection shows project files', async ({
|
|
file,
|
|
prisma,
|
|
}) => {
|
|
const { page, projectId, fileName } = file
|
|
|
|
await page.goto(`/projects/${projectId}`)
|
|
await expect(fileCard(page, fileName)).toBeVisible()
|
|
|
|
// Create a collection via the sidebar "+" button
|
|
await page.getByTestId('create-collection').click()
|
|
|
|
await expect(page).toHaveURL(/\/collections\/[^/]+/)
|
|
await expect(page.getByText('Collection created')).toBeVisible()
|
|
|
|
// The collection page is a recursive files-only view of the project
|
|
await expect(fileCard(page, fileName)).toBeVisible()
|
|
|
|
const collection = await prisma.collection.findFirst({ where: { projectId } })
|
|
expect(collection).not.toBeNull()
|
|
expect(collection?.name).toBe('Untitled Collection')
|
|
|
|
const project = await prisma.project.findUnique({ where: { id: projectId } })
|
|
expect(collection?.filter).toMatchObject({
|
|
sourceFolderId: project?.rootFolderId,
|
|
searchFilter: { conditions: [], recursively: true },
|
|
})
|
|
})
|