chore(workflow): add AI-assisted workflow commands and configurations
Add comprehensive workflow commands for AI-assisted development: - Claude commands: analyze, clarify, plan - Kilocode workflows: full feature development lifecycle - Opencode commands: specification and implementation workflows - Roo MCP configuration for tool integration Update .gitignore to exclude .astro build cache directories. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
23
apps/frontend/tests/auth.spec.ts
Normal file
23
apps/frontend/tests/auth.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { authService } from '../src/services/auth';
|
||||
|
||||
describe('Auth Service', () => {
|
||||
it('should login user', async () => {
|
||||
// Mock fetch
|
||||
global.fetch = vi.fn(() =>
|
||||
Promise.resolve({
|
||||
ok: true,
|
||||
json: () => Promise.resolve({ user: { id: 1, email: 'test@example.com' }, token: 'token' })
|
||||
})
|
||||
);
|
||||
|
||||
const result = await authService.login('test@example.com', 'password');
|
||||
expect(result.user.email).toBe('test@example.com');
|
||||
});
|
||||
|
||||
it('should get current user', async () => {
|
||||
authService.token = 'token';
|
||||
const user = await authService.getCurrentUser();
|
||||
expect(user).toBeDefined();
|
||||
});
|
||||
});
|
||||
10
apps/frontend/tests/components.spec.ts
Normal file
10
apps/frontend/tests/components.spec.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { render } from '@testing-library/react'; // Assume setup
|
||||
|
||||
describe('Header Component', () => {
|
||||
it('renders navigation links', () => {
|
||||
// const { getByText } = render(<Header />);
|
||||
// expect(getByText('關於恩群')).toBeInTheDocument();
|
||||
expect(true).toBe(true); // Placeholder
|
||||
});
|
||||
});
|
||||
19
apps/frontend/tests/contact.spec.ts
Normal file
19
apps/frontend/tests/contact.spec.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
|
||||
test('contact form submission', async ({ page }) => {
|
||||
await page.goto('/contact-us');
|
||||
|
||||
await page.fill('#name', 'Test User');
|
||||
await page.fill('#email', 'test@example.com');
|
||||
await page.fill('#message', 'Test message');
|
||||
|
||||
// Mock form submission
|
||||
await page.route('**/submit-contact', async route => {
|
||||
await route.fulfill({ status: 200, body: 'OK' });
|
||||
});
|
||||
|
||||
await page.click('button[type="submit"]');
|
||||
|
||||
// Check for success message or redirect
|
||||
await expect(page.locator('body')).toContainText('submitted');
|
||||
});
|
||||
Reference in New Issue
Block a user