feat: add advisor/contact flow tables and make Blog.authorId required
Deploy Canina / deploy (push) Successful in 25m44s
Deploy Canina / deploy (push) Successful in 25m44s
This commit is contained in:
1 parent
bb81f2c944
commit
d881dc491e
86 files changed
+507
-4111
No files matched your search
@@ -8,7 +8,6 @@ import { useUserStore } from '../../lib/store/userStore';
|
||||
import { useUIStore } from '../../lib/store/uiStore';
|
||||
import { useSettingsStore } from '../../lib/store/settingsStore';
|
||||
import { useCatalogMode } from '../../lib/useCatalogMode';
|
||||
import { productService } from '../../lib/services/productService';
|
||||
|
||||
vi.mock('next/navigation', () => ({
|
||||
usePathname: vi.fn(),
|
||||
@@ -35,10 +34,6 @@ vi.mock('../../lib/useCatalogMode', () => ({
|
||||
useCatalogMode: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('../../lib/services/productService', () => ({
|
||||
productService: { getProducts: vi.fn() },
|
||||
}));
|
||||
|
||||
describe('MobileBottomNav Component', () => {
|
||||
const mockRouterPush = vi.fn();
|
||||
const mockSetAuthModalOpen = vi.fn();
|
||||
@@ -85,7 +80,6 @@ describe('MobileBottomNav Component', () => {
|
||||
isCatalogOnly: false,
|
||||
allowCart: true,
|
||||
} as any);
|
||||
vi.mocked(productService.getProducts).mockResolvedValue({ data: [] } as any);
|
||||
});
|
||||
|
||||
it('renders all default 5 navigation tabs', () => {
|
||||
@@ -188,14 +182,6 @@ describe('MobileBottomNav Component', () => {
|
||||
expect(screen.getByText('مشاهده کاتالوگ و همه محصولات')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('routes mobile search submissions to universal search', () => {
|
||||
render(<MobileBottomNav />);
|
||||
fireEvent.click(screen.getByText('فروشگاه').closest('button')!);
|
||||
fireEvent.change(screen.getByPlaceholderText(/جستجوی دارو، ترکیب یا علامت بالینی/i), { target: { value: 'joint care' } });
|
||||
fireEvent.submit(screen.getByPlaceholderText(/جستجوی دارو، ترکیب یا علامت بالینی/i).closest('form')!);
|
||||
expect(mockRouterPush).toHaveBeenCalledWith('/search?q=joint%20care');
|
||||
});
|
||||
|
||||
it('opens menu bottom sheet when menu tab is clicked', () => {
|
||||
render(<MobileBottomNav />);
|
||||
|
||||
@@ -207,19 +193,4 @@ describe('MobileBottomNav Component', () => {
|
||||
expect(screen.getByText('مجله سلامت پت')).toBeInTheDocument();
|
||||
expect(screen.getByText('ویدیوهای بالینی')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("ensures all mobile bottom nav tabs have ergonomic touch targets with min-h-[48px]", () => {
|
||||
render(<MobileBottomNav />);
|
||||
|
||||
const homeLink = screen.getByText("خانه").closest("a");
|
||||
const menuBtn = screen.getByText("منو").closest("button");
|
||||
const shopBtn = screen.getByText("فروشگاه").closest("button");
|
||||
const accountBtn = screen.getByText("حساب من").closest("button");
|
||||
|
||||
expect(homeLink).toHaveClass("min-h-[48px]");
|
||||
expect(menuBtn).toHaveClass("min-h-[48px]");
|
||||
expect(shopBtn).toHaveClass("min-h-[48px]");
|
||||
expect(accountBtn).toHaveClass("min-h-[48px]");
|
||||
});
|
||||
|
||||
});
|
||||
Reference in new issue
Block a user