Skip to content

Commit

Permalink
fix prettier issue and unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelfras committed Jul 5, 2024
1 parent 065794d commit 91de035
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ describe('OptimizedSsrEngine', () => {
engineRunner.request('a');

tick(200);
expect(engineRunner.renders).toEqual(['a-0', 'a-0', 'a-0']);
expect(engineRunner.responses).toEqual(['a-0', 'a-0', 'a-0']);
}));
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export class LoadCmsNavigationItems extends StateUtils.EntityLoadAction {
export class LoadCmsNavigationItemsFail extends StateUtils.EntityFailAction {
readonly type = LOAD_CMS_NAVIGATION_ITEMS_FAIL;

constructor(nodeId: string, public error: ErrorActionType) {
constructor(
nodeId: string,
public error: ErrorActionType
) {
super(NAVIGATION_DETAIL_ENTITY, nodeId, error);
}
}
Expand Down
10 changes: 8 additions & 2 deletions projects/core/src/cms/store/actions/page.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ export class LoadCmsPageData extends StateUtils.EntityLoadAction {
export class LoadCmsPageDataFail extends StateUtils.EntityFailAction {
readonly type = LOAD_CMS_PAGE_DATA_FAIL;

constructor(pageContext: PageContext, public error: ErrorActionType) {
constructor(
pageContext: PageContext,
public error: ErrorActionType
) {
super(pageContext.type ?? '', pageContext.id, error);
}
}
Expand All @@ -50,7 +53,10 @@ export class CmsSetPageSuccessIndex extends StateUtils.EntitySuccessAction {
export class CmsSetPageFailIndex extends StateUtils.EntityFailAction {
readonly type = CMS_SET_PAGE_FAIL_INDEX;

constructor(pageContext: PageContext, public payload: string) {
constructor(
pageContext: PageContext,
public payload: string
) {
super(
pageContext.type ?? '',
pageContext.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export class SearchProducts implements Action {

export class SearchProductsFail implements ErrorAction {
readonly type = SEARCH_PRODUCTS_FAIL;
constructor(public error: ErrorModel, public auxiliary?: boolean) {}
constructor(
public error: ErrorModel,
public auxiliary?: boolean
) {}
}

export class SearchProductsSuccess implements Action {
Expand Down
10 changes: 8 additions & 2 deletions projects/core/src/product/store/actions/product.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export interface EntityScopedLoaderAction extends Action {
export class LoadProduct extends EntityScopedLoaderActions.EntityScopedLoadAction {
readonly type = LOAD_PRODUCT;

constructor(public payload: string, scope = '') {
constructor(
public payload: string,
scope = ''
) {
super(PRODUCT_DETAIL_ENTITY, payload, scope);
}
}
Expand All @@ -49,7 +52,10 @@ export class LoadProductFail extends EntityScopedLoaderActions.EntityScopedFailA
export class LoadProductSuccess extends EntityScopedLoaderActions.EntityScopedSuccessAction {
readonly type = LOAD_PRODUCT_SUCCESS;

constructor(public payload: Product, scope = '') {
constructor(
public payload: Product,
scope = ''
) {
super(PRODUCT_DETAIL_ENTITY, payload.code ?? '', scope);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ export class EntityLoadAction implements EntityLoaderAction {
export class EntityFailAction implements EntityLoaderAction {
type = ENTITY_FAIL_ACTION;
readonly meta: EntityLoaderMeta;
constructor(entityType: string, id: EntityId, public error?: any) {
constructor(
entityType: string,
id: EntityId,
public error?: any
) {
this.meta = entityFailMeta(entityType, id, error);
}
}
Expand Down

0 comments on commit 91de035

Please sign in to comment.