Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Angular version 18 update #1146

Closed
wants to merge 2 commits into from
Closed

Conversation

DhaaraniCIT
Copy link
Contributor

@DhaaraniCIT DhaaraniCIT commented Jan 10, 2025

Description

feat: Angular version 18 update

Clickup

https://app.clickup.com

Summary by CodeRabbit

  • Dependency Updates

    • Upgraded Angular framework and related libraries from version 17.3.x to 18.2.x
    • Updated zone.js to version 0.14.10
  • Testing Framework

    • Migrated HTTP client testing configuration from module-based to provider-based approach
    • Introduced provideHttpClient and withInterceptorsFromDi() for more flexible HTTP client setup
    • Replaced HttpClientModule and HttpClientTestingModule with new provider methods
    • Updated various components and services to utilize the new HTTP client configuration

@github-actions github-actions bot added the size/XL Extra Large PR label Jan 10, 2025
Copy link
Contributor

coderabbitai bot commented Jan 10, 2025

Walkthrough

The pull request introduces a comprehensive update to the Angular project's dependencies and testing configurations. The primary changes involve upgrading Angular-related packages from version 17.3.x to 18.2.x and modernizing the HTTP client testing setup across numerous test files. The modifications replace traditional HttpClientModule and HttpClientTestingModule imports with provider-based configurations using provideHttpClient, withInterceptorsFromDi(), and provideHttpClientTesting(), reflecting the latest Angular testing practices.

Changes

File/Group Change Summary
package.json Updated Angular and related package versions from 17.3.x to 18.2.x, including primeng and Storybook packages.
src/app/app.module.ts Replaced HttpClientModule with provideHttpClient(withInterceptorsFromDi()).
src/app/auth/login/login.component.spec.ts Replaced HttpClientModule with provideHttpClient(withInterceptorsFromDi()) in test setup.
src/app/core/guard/auth.guard.spec.ts Replaced HttpClientModule with provideHttpClient(withInterceptorsFromDi()) in test setup.
src/app/core/interceptor/jwt.interceptor.spec.ts Updated to use provideHttpClient and provideHttpClientTesting for HTTP client testing.
src/app/core/services/* Replaced HttpClientTestingModule with provideHttpClient(withInterceptorsFromDi()) and provideHttpClientTesting() across multiple service tests.
src/app/integrations/* Updated tests to use new provider-based HTTP client configuration, removing HttpClientModule and HttpClientTestingModule.
.gitignore Added entries for .nx/cache and .nx/workspace-data to ignore Nx workspace directories.

Poem

🐰 Hop, hop, Angular's new way!
Providers dance, modules fade away
HTTP testing, sleek and bright
Dependency injection's delight
CodeRabbit's framework takes flight! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f28805 and 29d94ee.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • .gitignore (1 hunks)
  • package.json (3 hunks)
🔇 Additional comments (6)
.gitignore (1)

82-83: LGTM! Appropriate Nx workspace entries added.

The additions of .nx/cache and .nx/workspace-data to .gitignore are correct and follow best practices for Nx workspace setups.

package.json (5)

Line range hint 24-88: ⚠️ Address remaining version compatibility issues.

While most packages have been updated appropriately, there are still some potential compatibility issues to address:

  1. Consider updating @types/jasmine (currently ~4.0.0) to a newer version
  2. Update karma and related packages to versions that better support Angular 18
  3. Consider updating @sentry/angular to ensure full compatibility

Please run:

ng update @angular-eslint/schematics@18
ng update @angular-eslint/builder@18

70-71: Review ESLint configuration for Angular 18.

The ESLint packages have been updated with exact versions:

  • @typescript-eslint/eslint-plugin: 7.11.0
  • @typescript-eslint/parser: 7.11.0
  • eslint: 8.57.0

Run this script to verify ESLint rules compatibility:

Also applies to: 73-73

✅ Verification successful

ESLint configuration is properly set up for Angular 18

The ESLint setup is correctly configured with compatible versions:

  • Angular ESLint packages (v18.4.3) match Angular 18
  • TypeScript ESLint packages (v7.11.0) are compatible with TypeScript 5.4.5
  • ESLint configuration includes appropriate rules for both TypeScript and Angular templates
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for presence of ESLint config
if [ -f ".eslintrc.json" ]; then
  echo "Checking ESLint config..."
  cat .eslintrc.json | jq '.extends, .overrides'
fi

# Check for any TypeScript/ESLint version mismatches
npm ls typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint

Length of output: 342


Script:

#!/bin/bash
# Check ESLint config content
echo "=== ESLint Configuration ==="
cat .eslintrc.json || echo "No .eslintrc.json found"

echo -e "\n=== Angular ESLint Files ==="
fd -e json -e js -e yaml -e yml . -E node_modules -E dist -E build | grep -i eslint

echo -e "\n=== Dependencies in package.json ==="
cat package.json | grep -A 1 -B 1 "@typescript-eslint\|eslint\|typescript"

Length of output: 5454


62-68: Review Storybook v8 migration impact.

The upgrade from Storybook v7 to v8 is a major version bump that might require migration steps.

Please ensure:

  1. All stories are updated to use the new syntax
  2. The build process is working correctly

Run this script to check for potential Storybook issues:

✅ Verification successful

Storybook v8 migration verification successful ✓

All stories follow modern Component Story Format (CSF) and are compatible with Storybook v8. No migration steps required as the codebase already implements the recommended patterns and APIs.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for old Storybook patterns
echo "Checking for outdated Storybook patterns..."
rg -l "storiesOf\(" -g "*.stories.ts" || true  # Old API
rg -l "addDecorator\(" -g "*.stories.ts" || true  # Deprecated API

Length of output: 193


Script:

#!/bin/bash
# Find all story files and analyze their content
echo "=== Finding all story files ==="
fd -e stories.ts -x echo "=== {} ===" \; -x cat {}

echo -e "\n=== Checking for CSF patterns ==="
# Check for proper CSF 3.0 exports
ast-grep --pattern 'export default { 
  $$$
} satisfies Meta$_'

echo -e "\n=== Checking for potential migration issues ==="
# Check for potentially problematic patterns
rg -l "moduleMetadata|componentWrapperDecorator|Story = \(" -g "*.stories.ts" || true

Length of output: 67249


24-35: Verify Angular packages compatibility.

The Angular packages have been updated to v18.2.x, which is good. However, some dependencies might need attention:

  • @auth0/angular-jwt is still on v5.1.0
  • @rxweb/reactive-form-validators is on v2.1.6

Run this script to check for any peer dependency warnings:

✅ Verification successful

Dependencies are compatible with Angular 18

Both @auth0/angular-jwt and @rxweb/reactive-form-validators are compatible with Angular 18:

  • @auth0/angular-jwt requires Angular >=14.0.0, which is satisfied
  • @rxweb/reactive-form-validators shows no peer dependency conflicts
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for peer dependency issues
npm ls @angular/core @angular/common @auth0/angular-jwt @rxweb/reactive-form-validators 2>&1 | grep -i "peer"

# Verify if these packages have Angular 18 support
for pkg in "@auth0/angular-jwt" "@rxweb/reactive-form-validators"; do
  echo "Checking $pkg..."
  npm view $pkg peerDependencies --json 2>/dev/null | jq '."@angular/core" // empty'
done

Length of output: 595


Script:

#!/bin/bash
# Check complete package information
for pkg in "@auth0/angular-jwt" "@rxweb/reactive-form-validators"; do
  echo "=== $pkg ==="
  npm view $pkg versions peerDependencies --json 2>/dev/null
done

# Search for these packages in package.json files
fd -e json -x grep -l "@auth0/angular-jwt\|@rxweb/reactive-form-validators" {} \; | while read -r file; do
  echo "=== Found in: $file ==="
  cat "$file" | grep -A 5 -B 5 "@auth0/angular-jwt\|@rxweb/reactive-form-validators"
done

Length of output: 4994


47-47: Verify PrimeNG v18 integration.

The upgrade to PrimeNG v18.0.2 is aligned with Angular v18. However, ensure all PrimeNG components are using the latest APIs.

Run this script to check for deprecated PrimeNG usage:

✅ Verification successful

PrimeNG v18 integration verified successfully

The codebase shows proper implementation of PrimeNG v18 components with current API patterns. No deprecated features or syntax were found in the component usage.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for potentially deprecated PrimeNG patterns
echo "Checking for deprecated PrimeNG patterns..."
rg -l "p-dialog\[" -g "*.html" || true  # Old dialog syntax
rg -l "p-footer\>" -g "*.html" || true  # Deprecated footer tag

Length of output: 261


Script:

#!/bin/bash
# Search for potentially deprecated PrimeNG patterns with fixed regex
echo "Checking for deprecated PrimeNG patterns..."

# Check for deprecated footer usage
echo "Checking p-footer usage..."
rg -l "<p-footer" -g "*.html" || true

# Check for old transition options
echo "Checking transition options..."
rg -l "showTransitionOptions|hideTransitionOptions" -g "*.ts,*.html" || true

# Check for common deprecated properties
echo "Checking deprecated properties..."
rg -l "dataKey=|scrollHeight=|responsive=|autoDisplay=" -g "*.html" || true

# Check PrimeNG component usage patterns
echo "Checking component usage..."
rg -l "p-table|p-dialog|p-dropdown|p-calendar" -g "*.html" || true

Length of output: 4042


Script:

#!/bin/bash
# Check actual component usage patterns in key files
echo "Analyzing PrimeNG component implementations..."

# Check dialog component usage
echo "Checking dialog implementations..."
rg -A 5 "<p-dialog" src/app/shared/components/dashboard/dashboard-export-log-dialog/dashboard-export-log-dialog.component.html || true

# Check table component usage
echo "Checking table implementations..."
rg -A 5 "<p-table" src/app/shared/components/export-log/export-log-table/export-log-table.component.html || true

# Check dropdown component usage
echo "Checking dropdown implementations..."
rg -A 5 "<p-dropdown" src/app/shared/components/input/dropdown/dropdown.component.html || true

Length of output: 1812


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🔭 Outside diff range comments (1)
src/app/core/services/qbd/qbd-iif-log/qbd-iif-logs.service.spec.ts (1)

Line range hint 22-26: Remove duplicate service injection.

The service is being injected twice, which is unnecessary and could lead to confusion:

});
-  service = TestBed.inject(QbdIifLogsService);
   injector = getTestBed();
   service = injector.inject(QbdIifLogsService);
   httpMock = injector.inject(HttpTestingController);
🧹 Nitpick comments (15)
src/app/core/services/si/si-core/si-auth.service.spec.ts (1)

1-1: LGTM! Migration to new HTTP testing providers is correct.

The changes properly implement Angular 18's recommended approach for HTTP client testing setup. The transition from HttpClientTestingModule to provider-based configuration with provideHttpClient and provideHttpClientTesting is correctly implemented.

Consider grouping related imports together for better organization:

 import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
+import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
 import { Token } from 'src/app/core/models/misc/token.model';
 import { getTestBed, TestBed } from '@angular/core/testing';
 import { Observable } from 'rxjs';
 import { SiAuthService } from './si-auth.service';
 import { environment } from 'src/environments/environment';
-import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

Also applies to: 7-7, 17-19

src/app/shared/components/helper/app-landing-page-header/app-landing-page-header.component.spec.ts (1)

18-19: Remove redundant comment.

The inline comment // Added RouterTestingModule for navigation testing is unnecessary as it's self-evident from the import.

-    imports: [RouterTestingModule // Added RouterTestingModule for navigation testing
+    imports: [RouterTestingModule
src/app/core/services/qbd/qbd-configuration/qbd-field-mapping.service.spec.ts (1)

1-1: LGTM! Consider improving readability.

The HTTP client configuration is correct, but the providers array could be more readable if split into multiple lines.

-    providers: [QbdFieldMappingService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
+    providers: [
+      QbdFieldMappingService,
+      provideHttpClient(withInterceptorsFromDi()),
+      provideHttpClientTesting()
+    ]

Also applies to: 7-7, 19-21

src/app/core/services/common/workspace.service.spec.ts (1)

Line range hint 40-40: Consider using more specific types in subscribe callbacks

Instead of using the generic {} type, consider defining proper interfaces for the response types to improve type safety and code maintainability.

-    service.postWorkspace().subscribe((value: {}) => {
+    service.postWorkspace().subscribe((value: WorkspaceResponse) => {
-    service.getWorkspace("orHVw3ikkCxJ").subscribe((value: {}) => {
+    service.getWorkspace("orHVw3ikkCxJ").subscribe((value: WorkspaceResponse) => {

Also applies to: 65-65

src/app/core/services/qbd/qbd-configuration/qbd-advanced-setting.service.spec.ts (1)

19-21: Consider improving readability with multi-line formatting

While the changes correctly implement Angular 18's HTTP testing setup, consider formatting the providers array across multiple lines for better readability:

-    providers: [QbdAdvancedSettingService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
+    providers: [
+      QbdAdvancedSettingService,
+      provideHttpClient(withInterceptorsFromDi()),
+      provideHttpClientTesting()
+    ]
src/app/core/services/travelperk/travelperk.service.spec.ts (1)

1-1: Consider documenting the new HTTP testing pattern

The changes consistently implement Angular 18's new provider-based HTTP testing configuration across all test files. Consider:

  1. Documenting this pattern in your testing guidelines
  2. Creating a shared test utility to encapsulate these providers
  3. Updating any remaining test files to follow this pattern

This will help maintain consistency as you continue updating the codebase to Angular 18.

src/app/integrations/qbd/qbd-shared/qbd-field-mapping/qbd-field-mapping.component.spec.ts (1)

44-50: Improve TestBed configuration formatting.

The providers array formatting can be improved for better readability.

 declarations: [QbdFieldMappingComponent],
 imports: [FormsModule, ReactiveFormsModule, RouterTestingModule, SharedModule, NoopAnimationsModule],
-    providers: [FormBuilder,
-        { provide: Router, useValue: routerSpy },
-        { provide: QbdFieldMappingService, useValue: service1 },
-        { provide: QbdWorkspaceService, useValue: service2 },
-        { provide: IntegrationsToastService, useValue: service3 }, provideHttpClient(withInterceptorsFromDi())]
+    providers: [
+        FormBuilder,
+        { provide: Router, useValue: routerSpy },
+        { provide: QbdFieldMappingService, useValue: service1 },
+        { provide: QbdWorkspaceService, useValue: service2 },
+        { provide: IntegrationsToastService, useValue: service3 },
+        provideHttpClient(withInterceptorsFromDi())
+    ]
src/app/core/services/org/org.service.spec.ts (1)

25-31: Improve TestBed configuration formatting.

The providers array formatting can be improved for better readability.

-    imports: [],
-    providers: [
-        { provide: StorageService, useValue: service1 },
-        provideHttpClient(withInterceptorsFromDi()),
-        provideHttpClientTesting()
-    ]
-});
+    imports: [],
+    providers: [
+        { provide: StorageService, useValue: service1 },
+        provideHttpClient(withInterceptorsFromDi()),
+        provideHttpClientTesting()
+    ]
+    });
src/app/core/services/qbd/qbd-configuration/qbd-export-setting.service.spec.ts (1)

20-22: Improve TestBed configuration formatting.

The providers array should be formatted for better readability.

-    imports: [],
-    providers: [QbdExportSettingService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
-});
+    imports: [],
+    providers: [
+        QbdExportSettingService,
+        provideHttpClient(withInterceptorsFromDi()),
+        provideHttpClientTesting()
+    ]
+    });
src/app/integrations/travelperk/travelperk.component.spec.ts (1)

47-57: Improve TestBed configuration formatting.

The providers array formatting can be improved for better readability.

     declarations: [TravelperkComponent],
     imports: [],
     providers: [
         { provide: TravelperkService, useValue: service1 },
         { provide: OrgService, useValue: service2 },
         { provide: EventsService, useValue: service3 },
         MessageService,
-        provideHttpClient(withInterceptorsFromDi()),
-        provideHttpClientTesting()
+        provideHttpClient(withInterceptorsFromDi()),
+        provideHttpClientTesting()
     ]
-})
+    })
src/app/integrations/qbd/qbd-main/qbd-mapping/qbd-generic-mapping/qbd-generic-mapping.component.spec.ts (1)

39-44: Consider reordering providers for better organization.

Group related providers together for better maintainability:

  1. Component-specific providers (FormBuilder, MessageService)
  2. Service mocks (QbdMappingService)
  3. HTTP-related providers (provideHttpClient, provideHttpClientTesting)
 declarations: [QbdGenericMappingComponent],
 imports: [],
 providers: [
+    // Component providers
     FormBuilder,
     MessageService,
+    // Service mocks
     { provide: QbdMappingService, useValue: service1 },
     { provide: WindowService, useValue: service2 },
     { provide: IntegrationsToastService, useValue: service3 },
+    // HTTP configuration
     provideHttpClient(withInterceptorsFromDi()),
     provideHttpClientTesting()
 ]
src/app/core/interceptor/jwt.interceptor.spec.ts (1)

32-52: Consider reorganizing providers for better clarity.

Group related providers together for better maintainability:

  1. Core services
  2. Interceptors
  3. Authentication-related providers
  4. HTTP configuration
 imports: [],
 providers: [
+    // Core services
     ApiService,
+    // Interceptors
     {
         provide: HTTP_INTERCEPTORS,
         useClass: JwtInterceptor,
         multi: true
     },
+    // Authentication
     {
         provide: JWT_OPTIONS,
         useValue: {}
     },
     {
         provide: AuthService,
         useValue: service1
     },
     JwtInterceptor,
     JwtHelperService,
+    // HTTP configuration
     provideHttpClient(withInterceptorsFromDi()),
     provideHttpClientTesting()
 ]
src/app/integrations/bamboo-hr/bamboo-hr.component.spec.ts (1)

43-52: Consider adding error handling interceptors for tests.

Add test-specific HTTP interceptors to handle and verify error responses consistently across tests.

 declarations: [BambooHrComponent],
 imports: [],
 providers: [
     FormBuilder,
     MessageService,
     { provide: OrgService, useValue: service1 },
     { provide: BambooHrService, useValue: service2 },
+    {
+      provide: HTTP_INTERCEPTORS,
+      useClass: TestErrorInterceptor,
+      multi: true
+    },
     provideHttpClient(withInterceptorsFromDi()),
     provideHttpClientTesting()
 ]
src/app/integrations/qbo/qbo.component.spec.ts (1)

Line range hint 36-47: Clean up window mock implementation

The window mock contains unnecessary properties that aren't used in the tests. Consider simplifying it to include only the required properties.

 windowServiceMock = {
   get nativeWindow() {
     return {
       location: {
         pathname: '/integrations/qbo'
-      },
-      // Add other required properties of Window object
-      clientInformation: {},
-      closed: false,
-      customElements: {} as any,
-      devicePixelRatio: 1
-      // Add more properties as needed
+      }
     } as Window;
   }
 };
src/app/integrations/qbd/qbd-main/qbd-dashboard/qbd-dashboard.component.spec.ts (1)

1-1: HTTP client setup is correct but improve providers array formatting

While the HTTP client setup is correctly implemented, the formatting of the providers array could be improved for better readability.

 declarations: [QbdDashboardComponent],
 imports: [RouterTestingModule],
 providers: [FormBuilder,
     { provide: QbdIifLogsService, useValue: service1 },
     { provide: QbdAdvancedSettingService, useValue: service2 },
-    { provide: IntegrationsToastService, useValue: service3 }, provideHttpClient(withInterceptorsFromDi())]
+    { provide: IntegrationsToastService, useValue: service3 },
+    provideHttpClient(withInterceptorsFromDi())
+]

Also applies to: 39-45

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c159616 and 2f28805.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (52)
  • package.json (2 hunks)
  • src/app/app.module.ts (2 hunks)
  • src/app/auth/login/login.component.spec.ts (2 hunks)
  • src/app/core/guard/auth.guard.spec.ts (2 hunks)
  • src/app/core/interceptor/jwt.interceptor.spec.ts (2 hunks)
  • src/app/core/interceptor/jwt.interceptor.ts (1 hunks)
  • src/app/core/services/bamboo-hr/bamboo-hr.service.spec.ts (2 hunks)
  • src/app/core/services/common/api.service.spec.ts (2 hunks)
  • src/app/core/services/common/auth.service.spec.ts (2 hunks)
  • src/app/core/services/common/clone-setting.service.spec.ts (2 hunks)
  • src/app/core/services/common/helper.service.spec.ts (1 hunks)
  • src/app/core/services/common/workspace.service.spec.ts (2 hunks)
  • src/app/core/services/integration/refiner.service.spec.ts (2 hunks)
  • src/app/core/services/misc/user.service.spec.ts (2 hunks)
  • src/app/core/services/org/org.service.spec.ts (3 hunks)
  • src/app/core/services/qbd/qbd-configuration/qbd-advanced-setting.service.spec.ts (2 hunks)
  • src/app/core/services/qbd/qbd-configuration/qbd-export-setting.service.spec.ts (2 hunks)
  • src/app/core/services/qbd/qbd-configuration/qbd-field-mapping.service.spec.ts (2 hunks)
  • src/app/core/services/qbd/qbd-core/qbd-auth.service.spec.ts (2 hunks)
  • src/app/core/services/qbd/qbd-core/qbd-workspace.service.spec.ts (2 hunks)
  • src/app/core/services/qbd/qbd-iif-log/qbd-iif-logs.service.spec.ts (2 hunks)
  • src/app/core/services/qbd/qbd-mapping/qbd-mapping.service.spec.ts (2 hunks)
  • src/app/core/services/si/si-configuration/si-advanced-setting.service.spec.ts (1 hunks)
  • src/app/core/services/si/si-configuration/si-export-setting.service.spec.ts (2 hunks)
  • src/app/core/services/si/si-configuration/si-import-setting.service.spec.ts (1 hunks)
  • src/app/core/services/si/si-core/si-auth.service.spec.ts (2 hunks)
  • src/app/core/services/si/si-core/si-workspace.service.spec.ts (2 hunks)
  • src/app/core/services/travelperk/travelperk.service.spec.ts (2 hunks)
  • src/app/integrations/bamboo-hr/bamboo-hr.component.spec.ts (2 hunks)
  • src/app/integrations/bamboo-hr/configuration/configuration.component.spec.ts (2 hunks)
  • src/app/integrations/intacct/intacct-main/intacct-dashboard/intacct-dashboard.component.spec.ts (3 hunks)
  • src/app/integrations/intacct/intacct-main/intacct-export-log/intacct-export-log.component.spec.ts (2 hunks)
  • src/app/integrations/intacct/intacct-shared/intacct-c1-import-settings/intacct-c1-import-settings.component.spec.ts (3 hunks)
  • src/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.spec.ts (3 hunks)
  • src/app/integrations/intacct/intacct.component.spec.ts (2 hunks)
  • src/app/integrations/integrations.component.spec.ts (2 hunks)
  • src/app/integrations/landing/landing.component.spec.ts (2 hunks)
  • src/app/integrations/qbd/qbd-main/qbd-dashboard/qbd-dashboard.component.spec.ts (2 hunks)
  • src/app/integrations/qbd/qbd-main/qbd-main.component.spec.ts (2 hunks)
  • src/app/integrations/qbd/qbd-main/qbd-mapping/qbd-generic-mapping/qbd-generic-mapping.component.spec.ts (3 hunks)
  • src/app/integrations/qbd/qbd-shared/qbd-advanced-setting/qbd-advanced-setting.component.spec.ts (2 hunks)
  • src/app/integrations/qbd/qbd-shared/qbd-export-setting/qbd-export-setting.component.spec.ts (2 hunks)
  • src/app/integrations/qbd/qbd-shared/qbd-field-mapping/qbd-field-mapping.component.spec.ts (2 hunks)
  • src/app/integrations/qbd/qbd.component.spec.ts (2 hunks)
  • src/app/integrations/qbo/qbo-shared/qbo-export-settings/qbo-export-settings.component.spec.ts (4 hunks)
  • src/app/integrations/qbo/qbo.component.spec.ts (2 hunks)
  • src/app/integrations/travelperk/travelperk.component.spec.ts (2 hunks)
  • src/app/shared/components/configuration/configuration-step-header/configuration-step-header.component.spec.ts (1 hunks)
  • src/app/shared/components/helper/app-landing-page-header/app-landing-page-header.component.spec.ts (2 hunks)
  • src/app/shared/components/qbd/helper/qbd-onboarding-stepper/qbd-onboarding-stepper.component.spec.ts (2 hunks)
  • src/app/shared/components/si/core/intacct-connector/intacct-connector.component.spec.ts (2 hunks)
  • src/app/shared/components/si/helper/skip-export/skip-export.component.spec.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/app/core/interceptor/jwt.interceptor.ts
🔇 Additional comments (60)
src/app/core/services/si/si-configuration/si-import-setting.service.spec.ts (2)

4-5: LGTM! HTTP client testing setup follows Angular v18 best practices.

The migration from HttpClientTestingModule to provider-based configuration is implemented correctly.

Also applies to: 12-14


7-7: Verify: Disabled test suite needs attention.

The test suite is currently disabled (xdescribe). Please verify if this is intentional or if it should be enabled as part of the Angular upgrade.

src/app/core/services/si/si-configuration/si-advanced-setting.service.spec.ts (2)

4-5: LGTM! Consistent implementation of HTTP client testing setup.

The changes align with the Angular v18 upgrade pattern seen across other files.

Also applies to: 12-14


7-7: Verify: Another disabled test suite found.

This is another disabled test suite (xdescribe). Consider creating a tracking issue to enable all disabled tests after the Angular upgrade.

Would you like me to create a GitHub issue to track the task of enabling all disabled test suites?

src/app/core/services/misc/user.service.spec.ts (1)

3-4: LGTM! HTTP client testing setup is properly configured.

The provider-based configuration is correctly implemented.

Also applies to: 13-15

src/app/shared/components/si/helper/skip-export/skip-export.component.spec.ts (2)

4-4: LGTM! Component testing setup follows Angular v18 patterns.

The HTTP client and form testing configuration is correctly implemented.

Also applies to: 6-6, 14-17


8-8: Verify: Multiple levels of disabled tests.

Both the test suite (xdescribe) and individual test case (xit) are disabled. This could indicate incomplete test implementation or migration issues.

Would you like me to help implement the missing test cases for this component?

Also applies to: 25-25

src/app/core/services/common/helper.service.spec.ts (2)

8-8: Test suite is disabled - needs attention

The test suite is marked with xdescribe, which means it's currently skipped. Please either:

  • Remove the 'x' prefix if tests are working correctly with Angular 18
  • Add a TODO comment explaining why tests are disabled
  • Fix any failing tests that led to disabling the suite

14-20: HTTP client testing setup looks good

The migration from HttpClientTestingModule to provider-based configuration is correctly implemented using:

  • Empty imports array
  • Proper providers setup with provideHttpClient and provideHttpClientTesting
src/app/shared/components/configuration/configuration-step-header/configuration-step-header.component.spec.ts (1)

13-16: Provider setup is consistent with Angular 18 patterns

The HTTP client testing configuration follows the recommended approach for Angular 18:

  • Correct usage of provideHttpClient and provideHttpClientTesting
  • Empty imports array
src/app/core/services/common/clone-setting.service.spec.ts (1)

17-19: HTTP testing configuration is correct

The setup properly includes:

  • HttpTestingController for mocking HTTP requests
  • Provider-based HTTP client configuration
src/app/core/services/integration/refiner.service.spec.ts (2)

17-19: Good reference implementation for Angular 18 testing

This test suite:

  • Is properly enabled (not using xdescribe)
  • Correctly implements the new HTTP testing providers
  • Can serve as a reference for fixing other disabled test suites

1-1: ⚠️ Systematic issues need attention

While the HTTP client testing changes for Angular 18 are consistently implemented across all files, there's a concerning pattern of disabled test suites (xdescribe). Recommendations:

  1. Use the working refiner.service.spec.ts as a reference
  2. Document any Angular 18 breaking changes affecting tests
  3. Create a tracking issue for re-enabling all test suites

Would you like me to:

  1. Generate a detailed comparison between working and disabled tests?
  2. Create a GitHub issue to track the test fixes?
src/app/core/services/si/si-configuration/si-export-setting.service.spec.ts (1)

18-20: LGTM! Proper implementation of Angular v18's provider-based testing setup.

The transition from HttpClientTestingModule to provideHttpClient + provideHttpClientTesting follows the recommended pattern for Angular v18.

src/app/integrations/intacct/intacct-main/intacct-export-log/intacct-export-log.component.spec.ts (1)

16-19: LGTM! Comprehensive provider configuration for Angular v18.

The setup includes all necessary providers (FormBuilder, Router, HttpClient) with proper configuration for testing.

src/app/core/guard/auth.guard.spec.ts (1)

22-28: LGTM! Proper integration of new HTTP client provider with existing test setup.

Good practice maintaining RouterTestingModule while transitioning to the new HTTP client provider pattern.

src/app/auth/login/login.component.spec.ts (3)

Line range hint 11-11: Verify why tests are skipped.

The test suite is marked with xdescribe, indicating that these tests are currently skipped. Please verify if this is intentional or if the tests need to be updated for Angular v18 compatibility.


26-41: LGTM! Proper provider configuration for Angular v18 testing.

The test setup correctly implements the new provider-based approach while maintaining all necessary mock providers for ActivatedRoute, AuthService, and Router.


1-1: Verify Angular v18 compatibility across the codebase.

While the HTTP client provider changes look good, it would be beneficial to verify that all test suites are running successfully with Angular v18. Run the following command to check for any skipped or failing tests:

✅ Verification successful

HTTP client configuration is correctly implemented

The HTTP client provider changes in the test setup are properly implemented using provideHttpClient(withInterceptorsFromDi()). While there are skipped tests in the codebase, they are not specifically related to HTTP client configuration and appear to be pre-existing. The skipped tests focus on component creation and navigation functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Find all spec files and check for xdescribe
echo "Checking for skipped test suites..."
rg -l "xdescribe" --type ts

# Note: In a real environment, you would also run the test suite
# but since we can't run tests in this environment, we're just checking for patterns

Length of output: 28571


Script:

#!/bin/bash
# Check content of login component spec file for HTTP client related tests
echo "Content of login.component.spec.ts:"
cat src/app/auth/login/login.component.spec.ts

Length of output: 1982

src/app/core/services/qbd/qbd-core/qbd-auth.service.spec.ts (1)

1-1: LGTM! Consistent implementation of HTTP testing providers.

The changes maintain consistency with other service specs and properly implement Angular 18's HTTP testing configuration.

Also applies to: 8-8, 18-20

src/app/integrations/qbd/qbd.component.spec.ts (1)

1-2: LGTM! Component test configuration updated correctly.

The changes properly implement Angular 18's HTTP testing setup while maintaining other necessary testing modules and providers.

Since this is a component test, verify that all HTTP interactions (if any) in the component work as expected with the new provider setup. Run the following to check for any HTTP-related code in the component:

Also applies to: 28-35

✅ Verification successful

HTTP client configuration is correctly set up for testing the QBD component

The test configuration properly supports the component's HTTP operations which are handled through injected services (QbdWorkspaceService). The providers provideHttpClient and provideHttpClientTesting are correctly configured to support these service dependencies.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for HTTP client usage in the QbdComponent
ast-grep --pattern 'class QbdComponent {
  $$$
  constructor($_) {
    $$$
  }
  $$$
}'

Length of output: 89


Script:

#!/bin/bash
# Find the component file
fd -t f qbd.component.ts

# Search for HttpClient usage
rg "HttpClient" -A 5 --type ts

Length of output: 75556


Script:

#!/bin/bash
# Get QbdComponent implementation
cat src/app/integrations/qbd/qbd.component.ts

# Look for service injections in constructor
ast-grep --pattern 'constructor($$$) {
  $$$
}'  src/app/integrations/qbd/qbd.component.ts

Length of output: 3072

src/app/shared/components/qbd/helper/qbd-onboarding-stepper/qbd-onboarding-stepper.component.spec.ts (1)

1-1: LGTM! Proper implementation of new HTTP testing configuration.

The changes correctly implement Angular 18's HTTP client testing setup while maintaining all necessary modules and providers for the component test.

Also applies to: 25-32

src/app/integrations/qbd/qbd-main/qbd-main.component.spec.ts (1)

4-4: LGTM! HTTP client configuration updated correctly.

The changes properly migrate the test configuration to use the new provider-based approach introduced in Angular 18, while maintaining other necessary configurations.

Also applies to: 11-11, 30-38

src/app/integrations/integrations.component.spec.ts (2)

1-2: LGTM! HTTP client configuration updated correctly.

The changes properly implement the new provider-based HTTP client configuration.

Also applies to: 24-32


Line range hint 11-11: Verify if test suite should remain disabled.

The test suite is currently disabled with xdescribe. Please verify if this was intentional or if it should be re-enabled as part of the Angular update.

src/app/shared/components/helper/app-landing-page-header/app-landing-page-header.component.spec.ts (1)

1-2: LGTM! HTTP client configuration updated correctly.

The changes properly implement the new provider-based HTTP client configuration while maintaining the RouterTestingModule.

Also applies to: 17-25

src/app/core/services/qbd/qbd-configuration/qbd-field-mapping.service.spec.ts (1)

Line range hint 11-11: Review disabled test suites across the codebase.

Multiple test suites are currently disabled with xdescribe. As part of the Angular 18 update, it would be beneficial to:

  1. Verify if these tests were disabled due to the update
  2. Create a plan to fix and re-enable them
  3. Ensure no regression issues are introduced

Also applies to: 9-9, 9-9

src/app/integrations/landing/landing.component.spec.ts (1)

6-7: HTTP client configuration updated correctly for Angular 18.

The transition from HttpClientModule/HttpClientTestingModule to the new provider-based approach is implemented correctly.

Consider adding HTTP interceptor tests.

Since you're using withInterceptorsFromDi(), consider adding test cases to verify that HTTP interceptors are properly applied.

Also applies to: 30-38

src/app/app.module.ts (1)

8-8: HTTP client configuration updated correctly for Angular 18.

The transition to provideHttpClient with withInterceptorsFromDi is implemented correctly.

Also applies to: 65-65

src/app/core/services/common/auth.service.spec.ts (1)

3-3: HTTP client testing configuration updated correctly for Angular 18.

The transition to provider-based HTTP client testing is implemented correctly.

Also applies to: 8-8, 25-32

src/app/core/services/common/api.service.spec.ts (1)

3-3: HTTP client testing configuration updated correctly for Angular 18.

The transition to provider-based HTTP client testing is implemented correctly.

Also applies to: 6-6, 22-28

src/app/core/services/si/si-core/si-workspace.service.spec.ts (2)

9-9: Re-enable the test suite

The test suite is currently disabled with xdescribe. Consider re-enabling it by changing to describe to ensure these tests are executed as part of the test suite.


17-19: LGTM! Proper implementation of Angular v18's HTTP testing setup

The migration from HttpClientTestingModule to the new provider-based approach is correctly implemented using provideHttpClient with withInterceptorsFromDi() and provideHttpClientTesting().

src/app/core/services/common/workspace.service.spec.ts (2)

9-9: Re-enable the test suite

The test suite is currently disabled with xdescribe. Consider re-enabling it by changing to describe to ensure these tests are executed as part of the test suite.


18-20: LGTM! Proper implementation of Angular v18's HTTP testing setup

The migration from HttpClientTestingModule to the new provider-based approach is correctly implemented using provideHttpClient with withInterceptorsFromDi() and provideHttpClientTesting().

src/app/core/services/qbd/qbd-core/qbd-workspace.service.spec.ts (2)

9-9: Re-enable the test suite

The test suite is currently disabled with xdescribe. Consider re-enabling it by changing to describe to ensure these tests are executed as part of the test suite.


17-19: LGTM! Proper implementation of Angular v18's HTTP testing setup

The migration from HttpClientTestingModule to the new provider-based approach is correctly implemented using provideHttpClient with withInterceptorsFromDi() and provideHttpClientTesting().

src/app/integrations/bamboo-hr/configuration/configuration.component.spec.ts (3)

Line range hint 10-10: Re-enable the test suite

The test suite is currently disabled with xdescribe. Consider re-enabling it by changing to describe to ensure these tests are executed as part of the test suite.


22-29: LGTM! Proper implementation of Angular v18's HTTP testing setup

The migration from HttpClientModule to the new provider-based approach is correctly implemented using provideHttpClient with withInterceptorsFromDi(). The component's testing configuration is properly set up with the necessary providers and declarations.


1-1: Verify all disabled test suites in the codebase

Let's check for any other disabled test suites that might need to be re-enabled as part of this update.

src/app/core/services/bamboo-hr/bamboo-hr.service.spec.ts (1)

22-28: LGTM! Modern HTTP testing setup

The changes correctly implement Angular 18's recommended approach for HTTP client testing by replacing the module-based configuration with the new provider-based setup.

src/app/shared/components/si/core/intacct-connector/intacct-connector.component.spec.ts (1)

29-40: LGTM! Proper component test configuration

The changes correctly implement Angular 18's HTTP client testing setup while maintaining proper component test configuration with all required dependencies.

src/app/core/services/travelperk/travelperk.service.spec.ts (1)

22-28: LGTM! Consistent HTTP testing setup

The changes correctly implement Angular 18's HTTP client testing configuration, maintaining consistency with other service tests in the codebase.

src/app/core/services/org/org.service.spec.ts (1)

12-12: Verify if test suite should be disabled.

The test suite is currently disabled with xdescribe. Please verify if this is intentional or if it should be re-enabled.

src/app/core/services/qbd/qbd-configuration/qbd-export-setting.service.spec.ts (1)

10-10: Verify if test suite should be disabled.

The test suite is currently disabled with xdescribe. Please verify if this is intentional or if it should be re-enabled.

src/app/integrations/travelperk/travelperk.component.spec.ts (2)

Line range hint 13-13: Verify if test suite should be disabled.

The test suite is currently disabled with xdescribe. Please verify if this is intentional or if it should be re-enabled.


1-1: Angular 18 HTTP Client Testing Migration: Overall Assessment

The migration from HttpClientModule/HttpClientTestingModule to provideHttpClient/provideHttpClientTesting is correctly implemented across all files. However, there are a few items that need attention:

  1. Several test suites are disabled with xdescribe. Please verify if this is intentional.
  2. Consider standardizing the TestBed configuration formatting across all spec files for better maintainability.

The migration pattern is consistent and follows Angular 18's best practices.

src/app/integrations/intacct/intacct.component.spec.ts (1)

14-15: HTTP client testing setup looks good!

The transition to the new provider-based approach for HTTP client testing is implemented correctly. The setup includes both provideHttpClient with interceptors and provideHttpClientTesting, following Angular v18's best practices.

Also applies to: 44-56

src/app/integrations/qbo/qbo.component.spec.ts (1)

14-15: HTTP client testing setup looks good!

The transition to the new provider-based approach for HTTP client testing is implemented correctly, following Angular v18's best practices.

Also applies to: 51-64

src/app/core/services/qbd/qbd-mapping/qbd-mapping.service.spec.ts (2)

4-4: HTTP client testing setup looks good!

The transition to the new provider-based approach for HTTP client testing is implemented correctly.

Also applies to: 9-9, 21-23


11-11: Verify if test suite should be disabled

The test suite is currently disabled with xdescribe. Please verify if this is intentional or if it should be enabled.

✅ Verification successful

Disabled test suite is part of a systematic pattern

The xdescribe in this file is part of a codebase-wide pattern where all QBD-related tests are currently disabled. This appears to be an intentional architectural decision as it consistently applies to all QBD services and components.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if other QBD test suites are also disabled
rg "xdescribe.*QBD" -A 1

Length of output: 26


Script:

#!/bin/bash
# Find all QBD-related test files
echo "=== QBD Test Files ==="
fd "qbd.*spec.ts$"

echo -e "\n=== Disabled Tests in QBD Files ==="
# Search for any disabled tests (xdescribe, xit, xtest) in QBD files
fd "qbd.*spec.ts$" --exec rg -i "xdescribe|xit|xtest" {} -A 1 || true

echo -e "\n=== Git History for the File ==="
# Check recent history of this specific file
git log -p --format="%h %s" src/app/core/services/qbd/qbd-mapping/qbd-mapping.service.spec.ts | head -n 20

Length of output: 10618

src/app/integrations/intacct/intacct-main/intacct-dashboard/intacct-dashboard.component.spec.ts (1)

3-3: LGTM! Modern HTTP client testing setup

The changes correctly implement Angular's new provider-based approach for HTTP client testing, replacing the older module-based setup with provideHttpClient and provideHttpClientTesting.

Also applies to: 17-17, 39-51

src/app/integrations/qbd/qbd-shared/qbd-advanced-setting/qbd-advanced-setting.component.spec.ts (1)

1-1: LGTM! Modern HTTP client setup

The changes correctly implement Angular's new provider-based approach for HTTP client configuration, replacing the older module-based setup with provideHttpClient.

Also applies to: 51-62

src/app/integrations/qbd/qbd-shared/qbd-export-setting/qbd-export-setting.component.spec.ts (1)

1-1: LGTM! Modern HTTP client setup

The changes correctly implement Angular's new provider-based approach for HTTP client configuration, replacing the older module-based setup with provideHttpClient.

Also applies to: 53-64

src/app/integrations/intacct/intacct-shared/intacct-c1-import-settings/intacct-c1-import-settings.component.spec.ts (1)

31-31: LGTM! Modern HTTP client testing setup

The changes correctly implement Angular's new provider-based approach for HTTP client testing, replacing the older module-based setup with provideHttpClient and provideHttpClientTesting.

Also applies to: 36-36, 73-89

package.json (1)

53-53: Confirm zone.js compatibility.

The zone.js update to ~0.14.10 is compatible with Angular 18.

src/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.spec.ts (2)

20-24: Update to modern HTTP testing pattern.

The test configuration has been updated to use the new provider-based approach for HTTP testing, which is the recommended pattern in Angular 18.


Line range hint 51-67: Verify test module configuration.

The TestBed configuration has been properly updated to use the new HTTP testing providers. The order of providers is correct with the router providers preceding HTTP providers.

src/app/integrations/qbo/qbo-shared/qbo-export-settings/qbo-export-settings.component.spec.ts (2)

8-8: Update to modern HTTP testing pattern.

The test configuration has been updated to use the new provider-based approach for HTTP testing, aligning with Angular 18 best practices.

Also applies to: 45-45


Line range hint 82-105: Verify test module configuration.

The TestBed configuration has been properly updated with:

  1. Removal of HttpClientTestingModule
  2. Addition of provideHttpClient and provideHttpClientTesting
  3. Correct ordering of providers

import { HttpClientTestingModule } from '@angular/common/http/testing';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { minimalUser } from '../../interceptor/jwt.fixture';

xdescribe('UserService', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Critical: Disabled test suite contains active test cases.

This test suite contains implemented test cases for user profile functionality but is currently disabled (xdescribe). This should be prioritized for re-enabling to ensure critical user functionality remains tested.

@@ -1,17 +1,19 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ConfigurationStepHeaderComponent } from './configuration-step-header.component';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

xdescribe('ConfigurationStepHeaderComponent', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Widespread test suite disablement confirmed

Found extensive evidence of disabled test suites across the codebase, with most component tests being disabled using xdescribe. This systematic disablement spans across core, integration, and shared components, confirming the pattern of disabled tests during the Angular 18 upgrade.

  • Over 100 test suites are disabled using xdescribe
  • Multiple individual test cases are disabled using xit
  • Affected areas include QBO, Xero, Sage300, and shared components
🔗 Analysis chain

Multiple disabled test suites detected

This is another test suite marked with xdescribe. The pattern of disabled tests across multiple files suggests there might be common issues with the Angular 18 upgrade that need to be addressed.

Run this script to check for other disabled tests:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Find all disabled test suites in spec files
echo "Checking for disabled test suites..."
rg "xdescribe|fdescribe|xit|fit" "src/**/*.spec.ts"

Length of output: 193


Script:

#!/bin/bash
# First, verify the existence of spec files
echo "Finding spec files..."
fd "\.spec\.ts$"

# Then search for disabled tests with context
echo -e "\nChecking for disabled test suites..."
fd "\.spec\.ts$" | xargs rg "xdescribe|fdescribe|xit|fit" -A 2

Length of output: 103514

Comment on lines +48 to +54
provide: ErrorHandler,
useClass: GlobalErrorHandler
},
{
provide: ErrorHandler,
useValue: Sentry.createErrorHandler()
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix duplicate ErrorHandler providers.

There are two ErrorHandler providers which could lead to conflicts:

  1. GlobalErrorHandler
  2. Sentry.createErrorHandler()

This might cause unpredictable error handling behavior.

Consider consolidating them into a single provider that combines both handlers:

-        {
-            provide: ErrorHandler,
-            useClass: GlobalErrorHandler
-        },
-        {
-            provide: ErrorHandler,
-            useValue: Sentry.createErrorHandler()
-        },
+        {
+            provide: ErrorHandler,
+            useClass: class CombinedErrorHandler extends GlobalErrorHandler {
+                constructor() {
+                    super();
+                    const sentryHandler = Sentry.createErrorHandler();
+                    const originalHandleError = this.handleError;
+                    this.handleError = (error: any) => {
+                        sentryHandler.handleError(error);
+                        originalHandleError.call(this, error);
+                    };
+                }
+            }
+        },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
provide: ErrorHandler,
useClass: GlobalErrorHandler
},
{
provide: ErrorHandler,
useValue: Sentry.createErrorHandler()
},
provide: ErrorHandler,
useClass: class CombinedErrorHandler extends GlobalErrorHandler {
constructor() {
super();
const sentryHandler = Sentry.createErrorHandler();
const originalHandleError = this.handleError;
this.handleError = (error: any) => {
sentryHandler.handleError(error);
originalHandleError.call(this, error);
};
}
}
},

import { UserService } from '../misc/user.service';
import { environment } from 'src/environments/environment';
import { Router } from '@angular/router';
import { loginResponse, minimalUser, tokenResponse } from '../../interceptor/jwt.fixture';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

xdescribe('AuthService', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Re-enable test suite.

The test suite is currently disabled with xdescribe. Consider re-enabling it to ensure the tests are running as part of your test suite.

-xdescribe('AuthService', () => {
+describe('AuthService', () => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
xdescribe('AuthService', () => {
describe('AuthService', () => {

import { environment } from 'src/environments/environment';
import { ApiService } from './api.service';
import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/http';
import { HttpErrorResponse, HttpEventType, HttpHeaders, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { Observable } from 'rxjs';

xdescribe('ApiService', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Re-enable test suite.

The test suite is currently disabled with xdescribe. Consider re-enabling it to ensure the tests are running as part of your test suite.

-xdescribe('ApiService', () => {
+describe('ApiService', () => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
xdescribe('ApiService', () => {
describe('ApiService', () => {

Comment on lines +41 to +42
provide: JWT_OPTIONS,
useValue: JWT_OPTIONS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix JWT_OPTIONS provider configuration.

The current JWT_OPTIONS provider configuration is incorrect as it's using the token itself as the value.

 {
     provide: JWT_OPTIONS,
-    useValue: JWT_OPTIONS
+    useValue: {}  // Add your JWT configuration options here
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
provide: JWT_OPTIONS,
useValue: JWT_OPTIONS
provide: JWT_OPTIONS,
useValue: {} // Add your JWT configuration options here

package.json Outdated
Comment on lines 24 to 35
"@angular-devkit/build-angular": "^18.2.12",
"@angular-eslint/schematics": "^17.5.1",
"@angular/animations": "^17.3.10",
"@angular/cli": "^17.3.8",
"@angular/common": "^17.3.10",
"@angular/compiler": "^17.3.10",
"@angular/compiler-cli": "^17.3.10",
"@angular/core": "^17.3.10",
"@angular/forms": "^17.3.10",
"@angular/platform-browser": "^17.3.10",
"@angular/platform-browser-dynamic": "^17.3.10",
"@angular/router": "^17.3.10",
"@angular/animations": "^18.2.13",
"@angular/cli": "^18.2.12",
"@angular/common": "^18.2.13",
"@angular/compiler": "^18.2.13",
"@angular/compiler-cli": "^18.2.13",
"@angular/core": "^18.2.13",
"@angular/forms": "^18.2.13",
"@angular/platform-browser": "^18.2.13",
"@angular/platform-browser-dynamic": "^18.2.13",
"@angular/router": "^18.2.13",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

⚠️ Critical version incompatibilities detected in Angular ecosystem

Several packages need to be updated to be compatible with Angular 18:

  • @angular-eslint/* packages are severely outdated (v14.1.2)
  • @angular-eslint/schematics (v17.5.1) needs to be updated to v18
  • Consider updating @auth0/angular-jwt to ensure compatibility

Please run:

ng update @angular-eslint/schematics@18
ng update @angular-eslint/builder@18
🔗 Analysis chain

Verify Angular 18 migration checklist.

The Angular packages have been updated from v17.3.x to v18.2.x. Ensure that:

  1. The Angular update guide has been followed (https://update.angular.io/?v=17.3-18.0)
  2. All breaking changes have been addressed
  3. The application has been tested thoroughly

Run the following script to check for any missed peer dependencies or version mismatches:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify package versions and potential conflicts
npm ls @angular/core @angular/common @angular/platform-browser @angular/platform-browser-dynamic @angular/forms @angular/router @angular/compiler @angular/compiler-cli @angular/animations @angular/cli @angular-devkit/build-angular

Length of output: 691


Script:

#!/bin/bash
# Get all Angular-related dependencies and their versions
cat package.json | jq -r '.dependencies, .devDependencies | to_entries[] | select(.key | contains("@angular") or contains("angular-")) | "\(.key): \(.value)"'

# Check for zone.js version which is crucial for Angular
cat package.json | jq -r '.dependencies["zone.js"] // .devDependencies["zone.js"] // "not_found"'

# Check TypeScript version
cat package.json | jq -r '.dependencies["typescript"] // .devDependencies["typescript"] // "not_found"'

Length of output: 936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Extra Large PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant