From b7e1b3d7c0a650a939f378d4f94d5b03219f0808 Mon Sep 17 00:00:00 2001 From: Pawel Fras Date: Wed, 22 Jan 2025 11:03:09 +0100 Subject: [PATCH] chore: refactor after review --- docs/migration/2211_ng19/migration.md | 7 ++++--- .../trending-searches/trending-searches.service.spec.ts | 7 +++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/migration/2211_ng19/migration.md b/docs/migration/2211_ng19/migration.md index 9fb1c1caaa5..5ba4f7278b2 100644 --- a/docs/migration/2211_ng19/migration.md +++ b/docs/migration/2211_ng19/migration.md @@ -3,7 +3,8 @@ Before upgrading Spartacus to the new version with Angular 18, you need to first: - upgrade Spartacus to version 2211.32.1 -- install Node 22 version and upgrade `@types/node` to version 22 +- install Node 22 version +- upgrade `@types/node` to version 22 ```bash npm i @types/node@22 ``` @@ -15,7 +16,7 @@ Before upgrading Spartacus to the new version with Angular 18, you need to first > **Warning** > -> Do not select `use-application-builder` migration when migrating to Angular 18. Applications created before SPA 2211.19 doesn't support this builder. Applications ?created starting from 2211.19 already supports it. +> Do not select `use-application-builder` migration when migrating to Angular 18. Applications created before SPA 2211.19 doesn't support this builder. Applications created starting from 2211.19 already support it. Follow the [Angular guidelines for upgrading from v17 to v18](https://angular.dev/update-guide?v=17.0-18.0&l=3) and bump the Angular version locally, and update other 3rd party dependencies from Angular ecosystem to versions compatible with Angular 18 (e.g. `@ng-select/ng-select@13`, `@ngrx/store@18`, `ngx-infinite-scroll@18`): @@ -30,7 +31,7 @@ git commit -m "update angular 18 and 3rd party deps angular 18 compatible" > **Warning** > -> Hit SPACE to unselect `use-application-builder` migration when migrating to Angular 19. Applications created before SPA 2211.19 doesn't support this builder. Applications created starting from 2211.19 already supports it. +> Hit SPACE to unselect `use-application-builder` migration when migrating to Angular 19. Applications created before SPA 2211.19 doesn't support this builder. Applications created starting from 2211.19 already support it. Follow the [Angular guidelines for upgrading from v18 to v19](https://angular.dev/update-guide?v=18.0-19.0&l=3) and bump the Angular version locally, and update other 3rd party dependencies from Angular ecosystem to versions compatible with Angular 19 (e.g. `@ng-select/ng-select@14`, `@ngrx/store@19`, `ngx-infinite-scroll@19`): diff --git a/integration-libs/cds/src/trending-searches/trending-searches.service.spec.ts b/integration-libs/cds/src/trending-searches/trending-searches.service.spec.ts index e64e36b837e..ff8667a7c4b 100644 --- a/integration-libs/cds/src/trending-searches/trending-searches.service.spec.ts +++ b/integration-libs/cds/src/trending-searches/trending-searches.service.spec.ts @@ -81,10 +81,10 @@ describe('TrendingSearchesService', () => { { searchPhrase: 'test1', count: 10 }, { searchPhrase: 'test2', count: 15 }, ]; + let searchPhrases: SearchPhrases[] = []; const subscription = service.getTrendingSearches().subscribe((result) => { - // Verify the result - expect(result).toEqual(mockSearchPhrases); + searchPhrases = result; }); // Fast-forward through the availability check @@ -97,6 +97,9 @@ describe('TrendingSearchesService', () => { expect(req.request.method).toBe('GET'); req.flush({ searchPhrases: mockSearchPhrases }); + // Verify the result + expect(searchPhrases).toEqual(mockSearchPhrases); + // Clean up subscription.unsubscribe(); service.ngOnDestroy();