eab516c7f3
- Added new Cypress commands for mocking admin-related API interactions, including list, create, update, delete, and change status functionalities. - Introduced data-cy attributes across various components (e.g., Breadcrumbs, Forms, Tables) to improve testability and accessibility. - Updated existing components to support new data-cy attributes for better integration with Cypress tests.
31 lines
608 B
TypeScript
31 lines
608 B
TypeScript
export type AdminRecord = {
|
|
id: string;
|
|
full_name: string;
|
|
email: string;
|
|
username: string;
|
|
status: "active" | "inactive";
|
|
role?: string;
|
|
};
|
|
|
|
export const ADMIN_COLUMNS = [
|
|
"row",
|
|
"full name",
|
|
"email",
|
|
"username",
|
|
"status",
|
|
"actions",
|
|
];
|
|
|
|
export const makeAdmin = (
|
|
overrides: Partial<AdminRecord> = {},
|
|
index = 1,
|
|
): AdminRecord => ({
|
|
id: `507f1f77bcf86cd7994390${(10 + index).toString().padStart(2, "0")}`,
|
|
full_name: `E2E Admin ${index}`,
|
|
email: `e2e-admin-${index}@example.com`,
|
|
username: `e2e-admin-${index}`,
|
|
status: "active",
|
|
role: "admin",
|
|
...overrides,
|
|
});
|