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.
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
/// <reference types="cypress" />
|
|
|
|
declare global {
|
|
namespace Cypress {
|
|
interface AdminListMockOptions {
|
|
users?: Record<string, any>[];
|
|
offset?: number;
|
|
limit?: number;
|
|
total?: number;
|
|
statusCode?: number;
|
|
delay?: number;
|
|
alias?: string;
|
|
query?: Record<string, string | number>;
|
|
}
|
|
|
|
interface MutationMockOptions {
|
|
statusCode?: number;
|
|
delay?: number;
|
|
alias?: string;
|
|
message?: string;
|
|
body?: Record<string, any>;
|
|
}
|
|
|
|
interface Chainable {
|
|
loginAsAdmin(): Chainable<void>;
|
|
getByCy(value: string): Chainable<JQuery<HTMLElement>>;
|
|
setAuthCookies(userOverrides?: Partial<Record<string, any>>): Chainable<void>;
|
|
mockAdminsList(options?: AdminListMockOptions): Chainable<void>;
|
|
mockCreateAdmin(options?: MutationMockOptions): Chainable<void>;
|
|
mockUpdateAdmin(id: string, options?: MutationMockOptions): Chainable<void>;
|
|
mockDeleteAdmin(id: string, options?: MutationMockOptions): Chainable<void>;
|
|
mockChangeAdminStatus(
|
|
id: string,
|
|
options?: MutationMockOptions,
|
|
): Chainable<void>;
|
|
}
|
|
}
|
|
}
|
|
|
|
export {};
|