Skip to content

Commit

Permalink
test(all): fix broken overload selection
Browse files Browse the repository at this point in the history
  • Loading branch information
griest024 committed Jan 27, 2025
1 parent fa7f4ed commit 5609835
Show file tree
Hide file tree
Showing 54 changed files with 60 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe('AddToCartNotificationComponent', () => {
it('should call dispatch a CloseAddToCartNotification action', () => {
spyOn(store, 'dispatch');
fixture.debugElement.query(By.css('.demo-add-to-cart-notification__close')).nativeElement.click();
expect(store.dispatch).toHaveBeenCalledWith(new CloseAddToCartNotification());
expect(<any>store.dispatch).toHaveBeenCalledWith(new CloseAddToCartNotification());
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('CartResolver', () => {
spyOn(store, 'dispatch');
cartResolver.resolve().subscribe();

expect(store.dispatch).toHaveBeenCalledWith(new ResolveCart());
expect(<any>store.dispatch).toHaveBeenCalledWith(new ResolveCart());
});

describe('when ResolveCartSuccess is dispatched with a cart', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('DemoHeaderContainer', () => {
const sidebarButton = fixture.debugElement.query(By.css('[header-menu-button]')).nativeElement;
sidebarButton.click();

expect(store.dispatch).toHaveBeenCalledWith(new ToggleSidebar());
expect(<any>store.dispatch).toHaveBeenCalledWith(new ToggleSidebar());
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -118,31 +118,31 @@ describe('SidebarViewportContainer', () => {
it('should call store.dispatch with a ToggleSidebar action', () => {
spyOn(store, 'dispatch');
component.toggle();
expect(store.dispatch).toHaveBeenCalledWith(new ToggleSidebar());
expect(<any>store.dispatch).toHaveBeenCalledWith(new ToggleSidebar());
});
});

describe('open', () => {
it('should call store.dispatch with a OpenSidebar action', () => {
spyOn(store, 'dispatch');
component.open();
expect(store.dispatch).toHaveBeenCalledWith(new OpenSidebar());
expect(<any>store.dispatch).toHaveBeenCalledWith(new OpenSidebar());
});
});

describe('close', () => {
it('should call store.dispatch with a CloseSidebar action', () => {
spyOn(store, 'dispatch');
component.close();
expect(store.dispatch).toHaveBeenCalledWith(new CloseSidebar());
expect(<any>store.dispatch).toHaveBeenCalledWith(new CloseSidebar());
});
});

describe('setVisibility', () => {
it('should call store.dispatch with a SetSidebarAction action', () => {
spyOn(store, 'dispatch');
component.setVisibility(true);
expect(store.dispatch).toHaveBeenCalledWith(new SetSidebarState(true));
expect(<any>store.dispatch).toHaveBeenCalledWith(new SetSidebarState(true));
});
});
});
Expand Down
2 changes: 0 additions & 2 deletions libs/auth/state/src/facades/auth/facade.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ export interface DaffAuthFacadeInterface extends DaffStoreFacade<Action> {
* Whether the current user is logged in.
*/
loggedIn$: Observable<boolean>;

dispatch(action: Action): void;
}
2 changes: 1 addition & 1 deletion libs/auth/state/src/facades/auth/facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('@daffodil/auth/state | DaffAuthFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
2 changes: 0 additions & 2 deletions libs/auth/state/src/facades/login/facade.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ import {
export interface DaffAuthLoginFacadeInterface extends DaffStoreFacade<Action> {
loading$: Observable<boolean>;
errors$: Observable<DaffStateError[]>;

dispatch(action: Action): void;
}
2 changes: 1 addition & 1 deletion libs/auth/state/src/facades/login/facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ describe('@daffodil/auth/state | DaffAuthLoginFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
2 changes: 0 additions & 2 deletions libs/auth/state/src/facades/register/facade.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ import {
export interface DaffAuthRegisterFacadeInterface extends DaffStoreFacade<Action> {
loading$: Observable<boolean>;
errors$: Observable<DaffStateError[]>;

dispatch(action: Action): void;
}
2 changes: 1 addition & 1 deletion libs/auth/state/src/facades/register/facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('@daffodil/auth/state | DaffAuthRegisterFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@ export interface DaffAuthResetPasswordFacadeInterface extends DaffStoreFacade<Ac

loading$: Observable<boolean>;
errors$: Observable<DaffStateError[]>;

dispatch(action: Action): void;
}
2 changes: 1 addition & 1 deletion libs/auth/state/src/facades/reset-password/facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('DaffAuthResetPasswordFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('DaffAuthorizeNetFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('@daffodil/cart-store-credit/routing | DaffCartStoreCreditClearErrorsGu
it('should dispatch DaffCartStoreCreditClearErrors', () => {
const expected = new DaffCartStoreCreditClearErrors();
expect(guard.canDeactivate()).toBeTrue();
expect(store.dispatch).toHaveBeenCalledWith(expected);
expect(<any>store.dispatch).toHaveBeenCalledWith(expected);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('@daffodil/cart/routing | DaffCartResolver', () => {
spyOn(store, 'dispatch');
cartResolver.resolve().subscribe();

expect(store.dispatch).toHaveBeenCalledWith(new DaffResolveCart());
expect(<any>store.dispatch).toHaveBeenCalledWith(new DaffResolveCart());
});

describe('when DaffResolveCartSuccess is dispatched', () => {
Expand Down
2 changes: 1 addition & 1 deletion libs/cart/state/src/facades/cart/cart.facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ describe('DaffCartFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('DaffCategoryPageIdResolver', () => {
it('should dispatch a DaffCategoryPageLoad action with the correct category id', () => {
spyOn(store, 'dispatch');
categoryResolver.resolve( route.snapshot );
expect(store.dispatch).toHaveBeenCalledWith(
expect(<any>store.dispatch).toHaveBeenCalledWith(
new DaffCategoryPageLoad({ id: '123', kind: DaffCategoryRequestKind.ID }),
);
});
Expand Down Expand Up @@ -143,7 +143,7 @@ describe('DaffCategoryPageIdResolver', () => {
it('should dispatch a DaffCategoryPageLoad action with the correct category id', () => {
spyOn(store, 'dispatch');
categoryResolver.resolve( route.snapshot );
expect(store.dispatch).toHaveBeenCalledWith(
expect(<any>store.dispatch).toHaveBeenCalledWith(
new DaffCategoryPageLoad({ id: '123', kind: DaffCategoryRequestKind.ID }),
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ describe('DaffCategoryPageUrlResolver', () => {
it('should dispatch a DaffCategoryPageLoadByUrl action with the currentPage', () => {
spyOn(store, 'dispatch');
categoryResolver.resolve(route.snapshot, router.routerState.snapshot);
expect(store.dispatch).toHaveBeenCalledWith(
expect(<any>store.dispatch).toHaveBeenCalledWith(
new DaffCategoryPageLoadByUrl({ url: `/${path}`, kind: DaffCategoryRequestKind.URL, currentPage: page }),
);
});
Expand All @@ -153,7 +153,7 @@ describe('DaffCategoryPageUrlResolver', () => {

spyOn(store, 'dispatch');
categoryResolver.resolve(route.snapshot, router.routerState.snapshot);
expect(store.dispatch).toHaveBeenCalledWith(
expect(<any>store.dispatch).toHaveBeenCalledWith(
new DaffCategoryPageLoadByUrl({ url: `/${path}`, kind: DaffCategoryRequestKind.URL }),
);
}));
Expand Down Expand Up @@ -260,7 +260,7 @@ describe('DaffCategoryPageUrlResolver', () => {
it('should dispatch a DaffCategoryPageLoadByUrl action with the currentPage', () => {
spyOn(store, 'dispatch');
categoryResolver.resolve(route.snapshot, router.routerState.snapshot);
expect(store.dispatch).toHaveBeenCalledWith(
expect(<any>store.dispatch).toHaveBeenCalledWith(
new DaffCategoryPageLoadByUrl({ url: `/${path}`, kind: DaffCategoryRequestKind.URL, currentPage: page }),
);
});
Expand All @@ -273,7 +273,7 @@ describe('DaffCategoryPageUrlResolver', () => {

spyOn(store, 'dispatch');
categoryResolver.resolve(route.snapshot, router.routerState.snapshot);
expect(store.dispatch).toHaveBeenCalledWith(
expect(<any>store.dispatch).toHaveBeenCalledWith(
new DaffCategoryPageLoadByUrl({ url: `/${path}`, kind: DaffCategoryRequestKind.URL }),
);
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('DaffCategoryFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('@daffodil/checkout/state | DaffCheckoutPlacedOrderFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
2 changes: 1 addition & 1 deletion libs/contact/state/src/facades/contact.facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('the DaffContactFacade', () => {
const action = { type: 'Type' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
2 changes: 1 addition & 1 deletion libs/core/state/src/collection/facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('@daffodil/core/state | DaffCollectionFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('@daffodil/customer-payment/routing | DaffCustomerPaymentClearErrorsGua
it('should dispatch DaffCustomerPaymentClearErrors', () => {
const expected = new DaffCustomerPaymentClearErrors();
expect(guard.canDeactivate()).toBeTrue();
expect(store.dispatch).toHaveBeenCalledWith(expected);
expect(<any>store.dispatch).toHaveBeenCalledWith(expected);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('@daffodil/customer-payment/routing | DaffCustomerPaymentResolver', ()
it('should dispatch a DaffCustomerPaymentList action', done => {
spyOn(store, 'dispatch');
resolver.resolve().subscribe(() => {
expect(store.dispatch).toHaveBeenCalledWith(new DaffCustomerPaymentList());
expect(<any>store.dispatch).toHaveBeenCalledWith(new DaffCustomerPaymentList());
done();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('@daffodil/customer-payment/state | DaffCustomerPaymentPageFacade', ()
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('@daffodil/customer-store-credit/routing | DaffCustomerStoreCreditClear
it('should dispatch DaffCustomerStoreCreditClearErrors', () => {
const expected = new DaffCustomerStoreCreditClearErrors();
expect(guard.canDeactivate()).toBeTrue();
expect(store.dispatch).toHaveBeenCalledWith(expected);
expect(<any>store.dispatch).toHaveBeenCalledWith(expected);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('@daffodil/customer-store-credit/routing | DaffCustomerStoreCreditResol
it('should dispatch a DaffCustomerStoreCreditLoad action', done => {
spyOn(store, 'dispatch');
resolver.resolve().subscribe(() => {
expect(store.dispatch).toHaveBeenCalledWith(new DaffCustomerStoreCreditLoad());
expect(<any>store.dispatch).toHaveBeenCalledWith(new DaffCustomerStoreCreditLoad());
done();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('@daffodil/customer-store-credit/state | DaffCustomerStoreCreditPageFac
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('@daffodil/customer/routing | DaffCustomerClearErrorsGuard', () => {
it('should dispatch DaffCustomerClearErrors', () => {
const expected = new DaffCustomerClearErrors();
expect(guard.canDeactivate()).toBeTrue();
expect(store.dispatch).toHaveBeenCalledWith(expected);
expect(<any>store.dispatch).toHaveBeenCalledWith(expected);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('@daffodil/customer/routing | DaffCustomerResolver', () => {
it('should dispatch a DaffCustomerLoad action', done => {
spyOn(store, 'dispatch');
resolver.resolve().subscribe(() => {
expect(store.dispatch).toHaveBeenCalledWith(new DaffCustomerLoad());
expect(<any>store.dispatch).toHaveBeenCalledWith(new DaffCustomerLoad());
done();
});
});
Expand Down
2 changes: 1 addition & 1 deletion libs/customer/state/src/facades/address/facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('@daffodil/customer/state | DaffCustomerAddressPageFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
2 changes: 1 addition & 1 deletion libs/customer/state/src/facades/customer/facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('@daffodil/customer/state | DaffCustomerPageFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('DaffGeographyFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('DaffNavigationFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('DaffNewsletterFacade', () => {
const action = { type: 'Type' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
2 changes: 1 addition & 1 deletion libs/order/state/src/facades/order/order.facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('DaffOrderFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
2 changes: 1 addition & 1 deletion libs/payment/state/src/facades/payment/facade.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('@daffodil/payment/state | DaffPaymentPageFacade', () => {
const action = { type: 'SOME_TYPE' };

facade.dispatch(action);
expect(store.dispatch).toHaveBeenCalledWith(action);
expect(<any>store.dispatch).toHaveBeenCalledWith(action);
expect(store.dispatch).toHaveBeenCalledTimes(1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('@daffodil/paypal/routing | DaffPaypalExpressApplyPaymentGuard', () =>
},
});
service.canActivate(route).subscribe(() => {
expect(store.dispatch).toHaveBeenCalledWith(expected);
expect(<any>store.dispatch).toHaveBeenCalledWith(expected);
});
});
});
Expand Down
Loading

0 comments on commit 5609835

Please sign in to comment.