diff --git a/generators/angular/templates/src/main/webapp/app/layouts/main/main.component.spec.ts.ejs b/generators/angular/templates/src/main/webapp/app/layouts/main/main.component.spec.ts.ejs
index cf8ff1f64185..33ce537a3af5 100644
--- a/generators/angular/templates/src/main/webapp/app/layouts/main/main.component.spec.ts.ejs
+++ b/generators/angular/templates/src/main/webapp/app/layouts/main/main.component.spec.ts.ejs
@@ -295,5 +295,8 @@ describe('MainComponent', () => {
<%_ } _%>
});
-@Component({ template: '' })
+@Component({
+ standalone: true,
+ template: '',
+})
export class BlankComponent {}
diff --git a/generators/angular/templates/src/main/webapp/app/shared/auth/has-any-authority.directive.spec.ts.ejs b/generators/angular/templates/src/main/webapp/app/shared/auth/has-any-authority.directive.spec.ts.ejs
index 0f730a52906e..f864f385e6d8 100644
--- a/generators/angular/templates/src/main/webapp/app/shared/auth/has-any-authority.directive.spec.ts.ejs
+++ b/generators/angular/templates/src/main/webapp/app/shared/auth/has-any-authority.directive.spec.ts.ejs
@@ -31,6 +31,8 @@ import { Account } from 'app/core/auth/account.model';
import HasAnyAuthorityDirective from './has-any-authority.directive';
@Component({
+ standalone: true,
+ imports: [HasAnyAuthorityDirective],
template: `
HasAnyAuthority="'ROLE_ADMIN'" #content>
`,
})
class TestHasAnyAuthorityDirectiveComponent {
@@ -43,8 +45,7 @@ describe('HasAnyAuthorityDirective tests', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
- imports: [HasAnyAuthorityDirective<%_ if (enableTranslation) { _%>, TranslateModule.forRoot()<%_ } _%>],
- declarations: [TestHasAnyAuthorityDirectiveComponent],
+ imports: [TestHasAnyAuthorityDirectiveComponent<%_ if (enableTranslation) { _%>, TranslateModule.forRoot()<%_ } _%>],
providers: [provideHttpClient(), AccountService],
});
}));
diff --git a/generators/angular/templates/src/main/webapp/app/shared/language/translate.directive.spec.ts.ejs b/generators/angular/templates/src/main/webapp/app/shared/language/translate.directive.spec.ts.ejs
index 21ddaa50366c..ffe404e24e79 100644
--- a/generators/angular/templates/src/main/webapp/app/shared/language/translate.directive.spec.ts.ejs
+++ b/generators/angular/templates/src/main/webapp/app/shared/language/translate.directive.spec.ts.ejs
@@ -23,6 +23,8 @@ import { TranslateModule, TranslateService } from '@ngx-translate/core';
import TranslateDirective from './translate.directive';
@Component({
+ standalone: true,
+ imports: [TranslateDirective],
template: ` Translate="test">
`,
})
class TestTranslateDirectiveComponent {}
@@ -33,8 +35,7 @@ describe('TranslateDirective Tests', () => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
- imports: [TranslateModule.forRoot(), TranslateDirective],
- declarations: [TestTranslateDirectiveComponent],
+ imports: [TranslateModule.forRoot(), TestTranslateDirectiveComponent],
});
}));