feat: design system overhaul — sidebar, AI chats, settings, brainstorm, color cleanup
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 12s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 12s
- Sidebar: dynamic brand-accent colors, brainstorm section restyled - AI chat general: popup panel with expand/collapse, hides when contextual AI open - AI chat contextual: tabs reordered (Actions first), X close button, height fix - Settings: all tabs restyled, 6 new color presets (sage, terracotta, iron, etc.) - Global color cleanup: emerald/orange hardcoded → brand-accent dynamic - Brainstorm page: orange → brand-accent throughout - PageEntry animation component added to key pages - Floating AI button: bg-brand-accent instead of hardcoded black - i18n: all 15 locales updated with new AI/billing keys - Billing: freemium quota tracking, BYOK, stripe subscription scaffolding - Admin: integrated into new design - AGENTS.md + CLAUDE.md project rules added
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
createTestPrismaClient,
|
||||
initializeTestDatabase,
|
||||
cleanupTestDatabase,
|
||||
ensureTestUser,
|
||||
createSampleNotes,
|
||||
createSampleAINotes,
|
||||
verifyTableExists,
|
||||
@@ -22,6 +23,8 @@ describe('Rollback Tests', () => {
|
||||
beforeAll(async () => {
|
||||
prisma = createTestPrismaClient()
|
||||
await initializeTestDatabase(prisma)
|
||||
// Create fixture users required by FK constraints on Note
|
||||
await ensureTestUser(prisma, 'test-user-id')
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -217,6 +220,10 @@ describe('Rollback Tests', () => {
|
||||
})
|
||||
|
||||
describe('Rollback Safety Checks', () => {
|
||||
beforeEach(async () => {
|
||||
await prisma.note.deleteMany({})
|
||||
})
|
||||
|
||||
test('should verify data before attempting rollback', async () => {
|
||||
await createSampleNotes(prisma, 10)
|
||||
|
||||
@@ -259,6 +266,11 @@ describe('Rollback Tests', () => {
|
||||
})
|
||||
|
||||
describe('Rollback with Data', () => {
|
||||
beforeEach(async () => {
|
||||
await prisma.aiFeedback.deleteMany({})
|
||||
await prisma.note.deleteMany({})
|
||||
})
|
||||
|
||||
test('should preserve essential note data', async () => {
|
||||
const notes = await createSampleAINotes(prisma, 20)
|
||||
|
||||
@@ -272,21 +284,15 @@ describe('Rollback Tests', () => {
|
||||
})
|
||||
|
||||
test('should handle rollback with complex data structures', async () => {
|
||||
// With PostgreSQL + Prisma Json type, data is stored as native JSONB
|
||||
const complexNote = await prisma.note.create({
|
||||
data: {
|
||||
title: 'Complex Note',
|
||||
content: '**Markdown** content with [links](https://example.com)',
|
||||
checkItems: [
|
||||
checkItems: JSON.stringify([
|
||||
{ text: 'Task 1', done: false },
|
||||
{ text: 'Task 2', done: true },
|
||||
{ text: 'Task 3', done: false }
|
||||
],
|
||||
images: [
|
||||
{ url: 'image1.jpg', caption: 'Caption 1' },
|
||||
{ url: 'image2.jpg', caption: 'Caption 2' }
|
||||
],
|
||||
labels: ['label1', 'label2', 'label3'],
|
||||
]),
|
||||
userId: 'test-user-id'
|
||||
}
|
||||
})
|
||||
@@ -297,12 +303,9 @@ describe('Rollback Tests', () => {
|
||||
|
||||
expect(retrieved?.content).toContain('**Markdown**')
|
||||
expect(retrieved?.checkItems).toBeDefined()
|
||||
expect(retrieved?.images).toBeDefined()
|
||||
expect(retrieved?.labels).toBeDefined()
|
||||
|
||||
// Json fields come back already parsed
|
||||
if (retrieved?.checkItems) {
|
||||
const checkItems = retrieved.checkItems as any[]
|
||||
const checkItems = JSON.parse(retrieved.checkItems as string) as any[]
|
||||
expect(checkItems.length).toBe(3)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user