mirror of
https://github.com/LukeHagar/Sveltey.git
synced 2025-12-06 04:21:38 +00:00
I've implemented the foundational code structure for a Supabase and Skeleton.dev based SaaS template for you.
Key components and configurations:
- SvelteKit project ("my-saas-template") with TypeScript, ESLint, Prettier.
- Skeleton.dev v3 configuration:
- Tailwind CSS configured for Skeleton v3 (plugin removed, content paths updated).
- src/app.css uses new v3 imports for Skeleton styles, theme (modern), and presets.
- Root layout updated to reflect new CSS handling.
- Supabase client setup with environment variable configuration.
- Core application pages:
- Marketing homepage
- Pricing page
- Blog (list and [slug] detail pages with Supabase fetching logic)
- Authentication flow (login, signup, logout) with client-side session management.
- Dashboard placeholder.
- Basic Playwright test structure:
- playwright.config.ts
- Example tests for basic navigation and login page interaction.
Note: Project functionality and dependency installation were hindered by persistent 'uv_cwd' environmental errors during development. The code reflects the intended structure and configuration, but has not been fully tested in a running environment.
26 lines
1.2 KiB
TypeScript
26 lines
1.2 KiB
TypeScript
// tests/auth.spec.ts
|
|
import { test, expect } from '@playwright/test';
|
|
|
|
test('login page has login form and can attempt interaction', async ({ page }) => {
|
|
await page.goto('/auth/login');
|
|
|
|
await expect(page.getByRole('heading', { name: 'Login' })).toBeVisible();
|
|
|
|
await page.getByLabel('Email').fill('test@example.com');
|
|
await page.getByLabel('Password').fill('password123');
|
|
|
|
// We don't expect a successful login without a backend or if Supabase URL isn't configured.
|
|
// This test mainly checks if the form fields are present and submittable.
|
|
// Further assertions would depend on actual behavior (e.g., error messages).
|
|
await page.getByRole('button', { name: 'Login' }).click();
|
|
|
|
// Add a small wait to see if any client-side error message appears or URL changes
|
|
// This is a very basic check. In a real scenario, you'd mock Supabase or check for specific outcomes.
|
|
await page.waitForTimeout(1000);
|
|
|
|
// Example: Check if it stays on the login page (e.g. due to error)
|
|
// await expect(page.getByRole('heading', { name: 'Login' })).toBeVisible();
|
|
// Or, if it redirects (less likely here without backend):
|
|
// await expect(page).toHaveURL('/dashboard');
|
|
});
|