mirror of
https://github.com/hanzoai/sign.git
synced 2026-10-21 01:21:51 +00:00
The product is branded Hanzo eSign (esign.hanzo.ai, repo hanzoai/esign). Rename all workspace packages @hanzo/sign-* → @hanzo/esign-* (1052 files) and align docker/Dockerfile turbo --scope/--filter to the actual remix package name @hanzo/esign (was a pre-existing mismatch with -remix that broke the build). Protected deps (@hanzo/insights, @hanzo/logo) untouched.
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { expect, test } from '@playwright/test';
|
|
|
|
import { NEXT_PUBLIC_WEBAPP_URL } from '@hanzo/esign-lib/constants/app';
|
|
import { seedBlankTemplate } from '@hanzo/esign-prisma/seed/templates';
|
|
import { seedUser } from '@hanzo/esign-prisma/seed/users';
|
|
|
|
import { apiSignin } from '../fixtures/authentication';
|
|
|
|
test.describe.configure({
|
|
mode: 'parallel',
|
|
});
|
|
|
|
test.describe('Unauthorized Access to Templates', () => {
|
|
test('should block unauthorized access to the template page', async ({ page }) => {
|
|
const { user, team } = await seedUser();
|
|
const template = await seedBlankTemplate(user, team.id);
|
|
|
|
const { user: unauthorizedUser } = await seedUser();
|
|
|
|
await apiSignin({
|
|
page,
|
|
email: unauthorizedUser.email,
|
|
redirectPath: `/t/${team.url}/templates/${template.id}`,
|
|
});
|
|
|
|
await page.goto(`${NEXT_PUBLIC_WEBAPP_URL()}/t/${team.url}/templates/${template.id}`);
|
|
await expect(page.getByRole('heading', { name: 'Team not found' })).toBeVisible();
|
|
});
|
|
|
|
test('should block unauthorized access to the template edit page', async ({ page }) => {
|
|
const { user, team } = await seedUser();
|
|
const template = await seedBlankTemplate(user, team.id);
|
|
|
|
const { user: unauthorizedUser } = await seedUser();
|
|
|
|
await apiSignin({
|
|
page,
|
|
email: unauthorizedUser.email,
|
|
redirectPath: `/t/${team.url}/templates/${template.id}/edit`,
|
|
});
|
|
|
|
await page.goto(`${NEXT_PUBLIC_WEBAPP_URL()}/t/${team.url}/templates/${template.id}/edit`);
|
|
await expect(page.getByRole('heading', { name: 'Team not found' })).toBeVisible();
|
|
});
|
|
});
|