GitHub

MockDaffCollectionFacade

import { MockDaffCollectionFacade } from '@daffodil/core/state/testing'

Can be used to mock out the DaffCollectionFacade in testing environments.

@Injectable()
class MockDaffCollectionFacade implements DaffCollectionFacadeInterface {
  metadata$: BehaviorSubject<DaffCollectionMetadata> = new BehaviorSubject(null)
  request$: BehaviorSubject<DaffCollectionRequest> = new BehaviorSubject(null)
  count$: BehaviorSubject<number> = new BehaviorSubject(0)
  currentPage$: BehaviorSubject<number> = new BehaviorSubject(0)
  totalPages$: BehaviorSubject<number> = new BehaviorSubject(0)
  pageSize$: BehaviorSubject<number> = new BehaviorSubject(0)
  sortOptions$: BehaviorSubject<DaffSortOption[]> = new BehaviorSubject([])
  appliedSortOption$: BehaviorSubject<string> = new BehaviorSubject(null)
  appliedSortDirection$: BehaviorSubject<DaffSortDirectionEnum> = new BehaviorSubject(null)
  filters$: BehaviorSubject<DaffFilters> = new BehaviorSubject({})
  appliedFilters$: BehaviorSubject<DaffFilters> = new BehaviorSubject({})

  dispatch(action: Action<string>): void
}

Properties

metadata$
BehaviorSubject<DaffCollectionMetadata>
Defaultnew BehaviorSubject(null)
Description

The page metadata for the collection.

request$
BehaviorSubject<DaffCollectionRequest>
Defaultnew BehaviorSubject(null)
Description

Builds a request that matches the current collection.

count$
BehaviorSubject<number>
Defaultnew BehaviorSubject(0)
Description

The number of items in the collection.

currentPage$
BehaviorSubject<number>
Defaultnew BehaviorSubject(0)
Description

The current page of items for the collection.

totalPages$
BehaviorSubject<number>
Defaultnew BehaviorSubject(0)
Description

The number of pages of items available in the collection.

pageSize$
BehaviorSubject<number>
Defaultnew BehaviorSubject(0)
Description

The number of items per page for the collection.

sortOptions$
BehaviorSubject<DaffSortOption[]>
Defaultnew BehaviorSubject([])
Description

The sort options available for the items of the collection.

appliedSortOption$
BehaviorSubject<string>
Defaultnew BehaviorSubject(null)
Description

The sort options available for the items of the collection.

appliedSortDirection$
BehaviorSubject<DaffSortDirectionEnum>
Defaultnew BehaviorSubject(null)
Description

The sort options available for the items of the collection.

filters$
BehaviorSubject<DaffFilters>
Defaultnew BehaviorSubject({})
Description

The filters available for the entities of the collection.

appliedFilters$
BehaviorSubject<DaffFilters>
Defaultnew BehaviorSubject({})
Description

The sort options available for the entities of the collection.

() Methods

dispatch
void
Parameters
Parameteraction: Action
Description