diff --git a/__tests__/ui-features.test.ts b/__tests__/ui-features.test.ts index f887fe6..109b3a5 100644 --- a/__tests__/ui-features.test.ts +++ b/__tests__/ui-features.test.ts @@ -13,12 +13,12 @@ describe('UI Features Tests', () => { }); it('should display color hex in frontend table', () => { - const filamentTablePath = join(process.cwd(), 'src', 'components', 'FilamentTable.tsx'); + const filamentTablePath = join(process.cwd(), 'src', 'components', 'FilamentTableV2.tsx'); const tableContent = readFileSync(filamentTablePath, 'utf-8'); - // Check for color hex display - expect(tableContent).toContain('filament.bojaHex'); - expect(tableContent).toContain('backgroundColor: filament.bojaHex'); + // Check for color display + expect(tableContent).toContain('ColorSwatch'); + expect(tableContent).toContain('color.hex'); }); it('should have checkboxes for boolean fields', () => { @@ -41,28 +41,25 @@ describe('UI Features Tests', () => { expect(adminContent).toContain('step="1"'); }); - it('should have predefined brand options', () => { + it('should have predefined material options', () => { const adminDashboardPath = join(process.cwd(), 'app', 'upadaj', 'dashboard', 'page.tsx'); const adminContent = readFileSync(adminDashboardPath, 'utf-8'); - // Check for brand select dropdown - expect(adminContent).toContain(''); - expect(adminContent).toContain(''); - expect(adminContent).toContain(''); + // Check for material select dropdown + expect(adminContent).toContain(''); + expect(adminContent).toContain(''); + expect(adminContent).toContain(''); }); - it('should have sidebar navigation in admin', () => { + it('should have admin header with navigation', () => { const adminDashboardPath = join(process.cwd(), 'app', 'upadaj', 'dashboard', 'page.tsx'); - const colorsPagePath = join(process.cwd(), 'app', 'upadaj', 'colors', 'page.tsx'); const dashboardContent = readFileSync(adminDashboardPath, 'utf-8'); - const colorsContent = readFileSync(colorsPagePath, 'utf-8'); - // Check for sidebar - expect(dashboardContent).toContain('href="/upadaj/dashboard"'); - expect(dashboardContent).toContain('href="/upadaj/colors"'); - expect(colorsContent).toContain('href="/upadaj/dashboard"'); - expect(colorsContent).toContain('href="/upadaj/colors"'); + // Check for admin header + expect(dashboardContent).toContain('Admin Dashboard'); + expect(dashboardContent).toContain('Nazad na sajt'); + expect(dashboardContent).toContain('Odjava'); }); it('should have Safari-specific select styling', () => { diff --git a/app/layout.tsx b/app/layout.tsx index 51dbdf7..daa3437 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,5 +1,6 @@ import type { Metadata } from 'next' import '../src/styles/index.css' +import { BackToTop } from '../src/components/BackToTop' export const metadata: Metadata = { title: 'Filamenteka', @@ -42,7 +43,10 @@ export default function RootLayout({ }} /> -
{children} + + {children} +