Skip to content

Commit 6d5035b

Browse files
committed
deps and checks fix
1 parent 0371cb9 commit 6d5035b

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

Diff for: integration-libs/punchout/components/punchout-close-session/punchout-close-session.component.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
*/
66

77
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
8-
import { ActiveCartFacade, MultiCartFacade } from '@spartacus/cart/base/root';
9-
import { AuthService, EventService, RoutingService } from '@spartacus/core';
8+
import { AuthService } from '@spartacus/core';
109
import { PunchoutFacade, PunchoutStoreService } from '@spartacus/punchout/root';
11-
import { map, Observable, of, Subscription, switchMap } from 'rxjs';
10+
import { map, Observable, of, switchMap } from 'rxjs';
1211

1312
@Component({
1413
selector: 'cx-punchout-close-session',
@@ -18,12 +17,7 @@ import { map, Observable, of, Subscription, switchMap } from 'rxjs';
1817
})
1918
export class PunchoutCloseSessionComponent {
2019
protected punchoutStoreService = inject(PunchoutStoreService);
21-
protected routingService = inject(RoutingService);
2220
protected authService = inject(AuthService);
23-
protected multiCartFacade = inject(MultiCartFacade);
24-
protected activeCartFacade = inject(ActiveCartFacade);
25-
protected eventService = inject(EventService);
26-
protected subscription = new Subscription();
2721
protected punchoutFacade = inject(PunchoutFacade);
2822

2923
hasSessionId$: Observable<boolean> = this.authService.isUserLoggedIn().pipe(

Diff for: integration-libs/punchout/core/facade/punchout.service.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ describe('Punchoutservice', () => {
162162
});
163163

164164
it('should getPunchoutSession calls connector', (done) => {
165+
spyOn(multiCartFacade, 'getCart').and.returnValue(of(mockCart));
165166
spyOn(connector, 'getPunchoutSession').and.returnValue(
166167
of(mockPunchoutSessionResponse)
167168
);
@@ -219,6 +220,7 @@ describe('Punchoutservice', () => {
219220

220221
it('should getPunchoutSession stays on page when isPageRefresh is true', (done) => {
221222
spyOn(routingService, 'go').and.returnValue(Promise.resolve(true));
223+
spyOn(multiCartFacade, 'getCart').and.returnValue(of(mockCart));
222224
spyOn(connector, 'getPunchoutSessionRequisition').and.returnValue(
223225
of(mockPunchoutRequisitionResponse)
224226
);
@@ -279,6 +281,7 @@ describe('Punchoutservice', () => {
279281

280282
it('should getPunchoutSession opens cart page when no product item and EDIT Level ', (done) => {
281283
spyOn(routingService, 'go').and.returnValue(Promise.resolve(true));
284+
spyOn(multiCartFacade, 'getCart').and.returnValue(of(mockCart));
282285
spyOn(connector, 'getPunchoutSession').and.returnValue(
283286
of({
284287
...mockPunchoutSessionResponse,
@@ -296,6 +299,7 @@ describe('Punchoutservice', () => {
296299

297300
it('should getPunchoutSession opens pdp when selectedItem is present ', (done) => {
298301
spyOn(routingService, 'go').and.returnValue(Promise.resolve(true));
302+
spyOn(multiCartFacade, 'getCart').and.returnValue(of(mockCart));
299303
spyOn(connector, 'getPunchoutSession').and.returnValue(
300304
of(mockPunchoutSessionResponse)
301305
);

Diff for: integration-libs/punchout/core/facade/punchout.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ export class PunchoutService implements PunchoutFacade {
291291
}
292292
return this.takeCart(state.punchoutSession.cartId).pipe(
293293
switchMap((cart) => {
294-
cart?.entries?.forEach((entry) => {
294+
cart?.entries?.forEach(() => {
295295
this.multiCartFacade.removeEntry(
296296
state.punchoutSession?.customerId as string,
297297
state.punchoutSession?.cartId as string,

Diff for: projects/schematics/src/dependencies.json

+1
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@
447447
"@spartacus/cart": "2211.38.0-1",
448448
"@spartacus/core": "2211.38.0-1",
449449
"@spartacus/schematics": "2211.38.0-1",
450+
"@spartacus/styles": "2211.38.0-1",
450451
"rxjs": "^7.8.2"
451452
},
452453
"@spartacus/s4-service": {

0 commit comments

Comments
 (0)