fix: Accounting sidebar link + E2E spec (FIBEROPS-240) #11
@@ -5,7 +5,7 @@ import { usePathname } from 'next/navigation';
|
||||
import { useAuthStore } from '@/lib/auth-store';
|
||||
import {
|
||||
LayoutDashboard, Users, UserPlus, FileText, CreditCard,
|
||||
ArrowLeftRight, Ticket, BarChart3, ScrollText, Settings,
|
||||
ArrowLeftRight, Ticket, BarChart3, ScrollText, Settings, BookOpen,
|
||||
} from 'lucide-react';
|
||||
|
||||
const navItems = [
|
||||
@@ -17,6 +17,7 @@ const navItems = [
|
||||
{ label: 'Remittances', href: '/remittances', icon: ArrowLeftRight, roles: ['admin', 'collector'] },
|
||||
{ label: 'Tickets', href: '/tickets', icon: Ticket, roles: [] },
|
||||
{ label: 'Reports', href: '/reports', icon: BarChart3, roles: ['admin', 'staff'] },
|
||||
{ label: 'Accounting', href: '/accounting', icon: BookOpen, roles: ['admin'] },
|
||||
{ label: 'Audit Log', href: '/audit-log', icon: ScrollText, roles: ['admin'] },
|
||||
{ label: 'Settings', href: '/settings', icon: Settings, roles: ['admin'] },
|
||||
];
|
||||
|
||||
50
e2e/accounting.spec.ts
Normal file
50
e2e/accounting.spec.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { login } from './helpers/auth';
|
||||
|
||||
test.describe('Accounting', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await login(page);
|
||||
});
|
||||
|
||||
test('chart of accounts page loads', async ({ page }) => {
|
||||
await page.goto('/accounting');
|
||||
await page.waitForTimeout(3000);
|
||||
await expect(page.locator('h1').filter({ hasText: 'Accounting' }).first()).toBeVisible({ timeout: 15000 });
|
||||
});
|
||||
|
||||
test('accounting sub-nav visible', async ({ page }) => {
|
||||
await page.goto('/accounting');
|
||||
await page.waitForTimeout(3000);
|
||||
await expect(page.locator('a').filter({ hasText: /Expenses/ }).first()).toBeVisible();
|
||||
});
|
||||
|
||||
test('journal entries page loads', async ({ page }) => {
|
||||
await page.goto('/accounting/journal-entries');
|
||||
await page.waitForTimeout(3000);
|
||||
await expect(page.locator('h1').filter({ hasText: 'Accounting' }).first()).toBeVisible({ timeout: 15000 });
|
||||
});
|
||||
|
||||
test('expenses page loads', async ({ page }) => {
|
||||
await page.goto('/accounting/expenses');
|
||||
await page.waitForTimeout(3000);
|
||||
await expect(page.locator('h1').filter({ hasText: 'Accounting' }).first()).toBeVisible({ timeout: 15000 });
|
||||
});
|
||||
|
||||
test('company accounts page loads', async ({ page }) => {
|
||||
await page.goto('/accounting/company-accounts');
|
||||
await page.waitForTimeout(3000);
|
||||
await expect(page.locator('h1').filter({ hasText: 'Accounting' }).first()).toBeVisible({ timeout: 15000 });
|
||||
});
|
||||
|
||||
test('financial reports page loads', async ({ page }) => {
|
||||
await page.goto('/accounting/reports');
|
||||
await page.waitForTimeout(3000);
|
||||
await expect(page.locator('text=Trial Balance').first()).toBeVisible({ timeout: 15000 });
|
||||
});
|
||||
|
||||
test('accounting link in sidebar', async ({ page }) => {
|
||||
await page.goto('/dashboard');
|
||||
await page.waitForTimeout(2000);
|
||||
await expect(page.locator('a[href="/accounting"]')).toBeVisible();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user