Skip to content

Commit

Permalink
Fix store testing package (#4520)
Browse files Browse the repository at this point in the history
* Fix store testing package

* Update public-api.ts

Co-authored-by: Richard Cox <richard-cox@users.noreply.github.com>
Co-authored-by: Richard Cox <richard.cox@suse.com>
  • Loading branch information
3 people authored Aug 21, 2020
1 parent 77d5a20 commit 027f9c3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 19 deletions.
18 changes: 16 additions & 2 deletions src/frontend/packages/store/src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@
* Public API Surface of store
*/


// Helpers
export * from './helpers/store-helpers';

// App State
export { AppState } from './app-state';

export { flattenPagination, PaginationFlattener } from './helpers/paginated-request-helpers';
// Used by store testing module
export { CATALOGUE_ENTITIES, EntityCatalogFeatureModule } from './entity-catalog.module';
export { entityCatalog, TestEntityCatalog } from './entity-catalog/entity-catalog';
export { EntityCatalogEntityConfig } from './entity-catalog/entity-catalog.types';
export { endpointEntityType, stratosEntityFactory } from './helpers/stratos-entity-factory';
export { appReducers } from './reducers.module';
export { getDefaultRequestState, rootUpdatingKey } from './reducers/api-request-reducer/types';
export { getDefaultPaginationEntityState } from './reducers/pagination-reducer/pagination-reducer-reset-pagination';
export { NormalizedResponse } from './types/api.types';
export { SessionData, SessionDataEndpoint } from './types/auth.types';
export { getDefaultRolesRequestState } from './types/current-user-roles.types';
export { EndpointModel } from './types/endpoint.types';
export { BaseEntityValues } from './types/entity.types';
export { WrapperRequestActionSuccess } from './types/request.types';

export { flattenPagination, PaginationFlattener } from './helpers/paginated-request-helpers';
32 changes: 18 additions & 14 deletions src/frontend/packages/store/testing/src/store-test-helper.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import { ModuleWithProviders } from '@angular/core';
import { TestBed } from '@angular/core/testing';
import { Store, StoreModule } from '@ngrx/store';

import { AppState } from '../../src/app-state';
import { entityCatalog } from '../../src/entity-catalog/entity-catalog';
import { EntityCatalogEntityConfig } from '../../src/entity-catalog/entity-catalog.types';
import { endpointEntityType, stratosEntityFactory } from '../../src/helpers/stratos-entity-factory';
import { appReducers } from '../../src/reducers.module';
import { getDefaultRequestState, rootUpdatingKey } from '../../src/reducers/api-request-reducer/types';
import { getDefaultPaginationEntityState } from '../../src/reducers/pagination-reducer/pagination-reducer-reset-pagination';
import { NormalizedResponse } from '../../src/types/api.types';
import { SessionData, SessionDataEndpoint } from '../../src/types/auth.types';
import { getDefaultRolesRequestState } from '../../src/types/current-user-roles.types';
import { EndpointModel } from '../../src/types/endpoint.types';
import { BaseEntityValues } from '../../src/types/entity.types';
import { WrapperRequestActionSuccess } from '../../src/types/request.types';
import {
appReducers,
AppState,
BaseEntityValues,
endpointEntityType,
EndpointModel,
entityCatalog,
EntityCatalogEntityConfig,
getDefaultPaginationEntityState,
getDefaultRequestState,
getDefaultRolesRequestState,
NormalizedResponse,
rootUpdatingKey,
SessionData,
SessionDataEndpoint,
stratosEntityFactory,
WrapperRequestActionSuccess,
} from '@stratosui/store';

export const testSCFEndpointGuid = '01ccda9d-8f40-4dd0-bc39-08eea68e364f';
const testSCFSessionEndpoint: SessionDataEndpoint = {
Expand Down
4 changes: 1 addition & 3 deletions src/frontend/packages/store/testing/src/store-test.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { NgModule } from '@angular/core';

import { CATALOGUE_ENTITIES, EntityCatalogFeatureModule } from '../../src/entity-catalog.module';
import { entityCatalog, TestEntityCatalog } from '../../src/entity-catalog/entity-catalog';
import { CATALOGUE_ENTITIES, entityCatalog, EntityCatalogFeatureModule, TestEntityCatalog } from '@stratosui/store';

@NgModule({
imports: [
Expand Down

0 comments on commit 027f9c3

Please sign in to comment.