All files / src/pages/admin pro-detail.fixtures.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 0/0
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116          7x         7x   7x                                                                               7x                                                               7x                                       7x                      
import { vi } from "vitest";
import type { Pro, Project, TeamMember } from "../../lib/api";
import { createMockRouterState } from "../../test";
 
// Mock router state
export const mockRouterState = createMockRouterState(
	"/admin/pros/pro-123",
);
 
// Mock TanStack Router
export const mockNavigate = vi.fn();
 
export const mockPro = {
	id: "pro-123",
	businessName: "Test Interiors",
	slug: "test-interiors",
	status: "published",
	whatsapp: "919876543210",
	description: "A premium interior design studio",
	profileImage: null,
	isFeatured: false,
	businessTypeId: "bt-1",
	businessTypesSecondary: null,
	timelineCapabilities: null,
	customerSegmentId: "cs-1",
	customerSegmentsSecondary: null,
	projectScaleIds: null,
	serviceCategoryIds: ["sc-1"],
	materialTagIds: ["mt-1"],
	brandsWorkWith: null,
	brandsOfficialPartner: null,
	serviceAreaIds: null,
	cityId: "city-1",
	phoneAlternate: null,
	email: "info@testinteriors.com",
	businessAddress: "123 Design Street",
	yearsInBusiness: 5,
	teamSize: "2-5",
	languagesSpoken: ["English", "Hindi"],
	coverImage: null,
	profileFields: null,
	acceptsRushOrders: true,
	rushOrderPremium: "20_percent",
	viewCount: 100,
	lastViewedAt: "2024-01-15T00:00:00Z",
	metaTitle: null,
	metaDescription: null,
	ogImage: null,
	dateCreated: "2024-01-01T00:00:00Z",
	dateUpdated: "2024-01-01T00:00:00Z",
} as unknown as Pro;
 
export const mockProjects: Project[] = [
	{
		id: "project-1",
		proId: "pro-123",
		title: "Modern Kitchen Renovation",
		status: "published",
		description: "Complete kitchen makeover",
		sort: 1,
		isFeatured: false,
		dateCreated: "2024-01-01T00:00:00Z",
		dateUpdated: "2024-01-01T00:00:00Z",
		scope: null,
		workedAreaIds: null,
		localityId: null,
		propertyType: null,
		propertySize: null,
		projectAreaSqft: null,
		budgetRange: null,
		duration: null,
		materialTagIds: null,
		isBeforeAfter: false,
		clientTestimonial: null,
		yearCompleted: null,
		metaTitle: null,
		metaDescription: null,
		ogImage: null,
		useRooms: false,
	defaultRoomId: null,
		styleTagIds: null,
	},
];
 
export const mockTeamMembers: TeamMember[] = [
	{
		id: 1,
		userId: "user-1",
		role: "owner",
		isActive: true,
		user: { id: "user-1", name: "John Doe", email: "john@example.com" },
		dateCreated: "2024-01-01T00:00:00Z",
	},
	{
		id: 2,
		userId: "user-2",
		role: "manager",
		isActive: true,
		user: { id: "user-2", name: "Jane Smith", email: "jane@example.com" },
		dateCreated: "2024-01-01T00:00:00Z",
	},
];
 
// Taxonomy mock data
export const taxonomyMockData = {
	isLoading: false,
	businessTypes: [
		{ id: "bt-1", name: "Interior Designer", slug: "interior-designer" },
	],
	customerSegments: [{ id: "cs-1", name: "Premium", slug: "premium" }],
	serviceCategories: [{ id: "sc-1", name: "Kitchen", slug: "kitchen" }],
	materialTags: { Wood: [{ id: "mt-1", name: "Plywood", slug: "plywood" }] },
	brands: { Furniture: [{ id: "br-1", name: "IKEA", slug: "ikea" }] },
	cities: [{ id: "city-1", name: "Mumbai", slug: "mumbai" }],
};