Options
All
  • Public
  • Public/Protected
  • All
Menu

A utility class that mock any pageable endpoint that takes one parameter

Hierarchy

  • MockEndpoint

Index

Constructors

Properties

Methods

Constructors

Properties

content: string[] = []

The content that is queries by the requests.

Methods

  • getPagination(params: HttpParams): RequestedPagination
  • search(filter: unknown, params: HttpParams): Observable<Page<unknown>>
  • Parameters

    • filter: unknown

      a filtering argument. This mock ignores it.

    • params: HttpParams

      pagination configuration. The mock extracts the size and page property to format the result properly.

    Returns Observable<Page<unknown>>

    an Observable containing a properly formatted Page object.

    The pagination attributes are filled according to the request and the endpoints [content]{@link MockEndpoint#content}.

    If an empty Page should be returned the returned object has its content attribute set to some object (to match backend and resource service behavior). Otherwise the content attribute contains the corresponding subsection fo the [content]{@link MockEndpoint#content} array.

Generated using TypeDoc