import faker from 'faker' ; export const mockUnauthorizedError = ( url ) : void => { cy . intercept ( { method : 'POST' , url } , { statusCode : 401 , body : { error : faker . random . words ( ) } } ) . as ( 'request' ) ; } ; export const mockForbiddenError = ( url , method ) : void => { cy . intercept ( { method , url } , { statusCode : 403 , body : { error : faker . random . words ( ) } } ) . as ( 'request' ) ; } ; export const mockServerError = ( url , method ) : void => { cy . intercept ( { method , url } , { statusCode : faker . helpers . randomize ( [ 400 , 404 , 500 ] ) , body : { error : faker . random . words ( ) } } ) . as ( 'request' ) ; } ; export const mockOk = ( url , method , fixture , alias = 'request' ) : void => { cy . intercept ( { method , url } , { statusCode : 200 , fixture } ) . as ( alias ) ; } ;