Repository: jhipster/jhipster-lite (java)

Issue:
Tikui, vue & cypress headless failling
When using tikui on a vue application with cypress component testing `test:component:headless` fails to load styles: 

```sh
15:20:08 [vite] http proxy error: /tikui.css
Error: connect ECONNREFUSED 127.0.0.1:9005
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1549:16)
```

This then result in errors for tests that needs css to make thinks visible.

Dunno if we should build the CSS or start tikui beforehand

@Gnuk any idea on that (I made no real investigation on my side)

For now, I'm starting Tikui with

```sh
    - '(npm run dev:tikui &) > tikui.log'
```

Pull request description:
Tikui, vue & cypress headless failling
Fix #11642 

Patch:
diff --git a/src/main/java/tech/jhipster/lite/generator/client/angular/security/jwt/domain/AngularJwtModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/client/angular/security/jwt/domain/AngularJwtModuleFactory.java
index 50856542a..9c498a104 100644
--- a/src/main/java/tech/jhipster/lite/generator/client/angular/security/jwt/domain/AngularJwtModuleFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/client/angular/security/jwt/domain/AngularJwtModuleFactory.java
@@ -33,7 +33,6 @@ public class AngularJwtModuleFactory {
       {
         path: '',
         loadComponent: () => import('./login/login.component'),
-        title: 'Login',
       },\
     """;
 
diff --git a/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java
index 1e6cbc405..644129d19 100644
--- a/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java
@@ -32,10 +32,10 @@ public class CypressModuleFactory {
     return commonCypressModuleBuilder(properties, CYPRESS_COMPONENT_TESTS)
       .packageJson()
         .addDevDependency(packageName("start-server-and-test"), COMMON)
-        .addScript(scriptKey("test:component"), scriptCommand("start-server-and-test start http://localhost:9000 'cypress open --e2e --config-file src/test/webapp/component/cypress-config.ts'"))
+        .addScript(scriptKey("test:component"), scriptCommand("start-server-and-test dev http://localhost:9000 'cypress open --e2e --config-file src/test/webapp/component/cypress-config.ts'"))
         .addScript(
           scriptKey("test:component:headless"),
-          scriptCommand("start-server-and-test start http://localhost:9000 'cypress run --headless --config-file src/test/webapp/component/cypress-config.ts'")
+          scriptCommand("start-server-and-test dev http://localhost:9000 'cypress run --headless --config-file src/test/webapp/component/cypress-config.ts'")
         )
         .and()
       .context()
diff --git a/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactory.java
index c3a69e222..1ba969d6e 100644
--- a/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactory.java
@@ -30,8 +30,8 @@ public class PlaywrightModuleFactory {
     return commonPlaywrightModuleBuilder(properties, WEBAPP_COMPONENT_TESTS)
       .packageJson()
         .addDevDependency(packageName("start-server-and-test"), COMMON)
-        .addScript(scriptKey("test:component"), scriptCommand("start-server-and-test start http://localhost:9000 'playwright test --ui --config src/test/webapp/component/playwright.config.ts'"))
-        .addScript(scriptKey("test:component:headless"), scriptCommand("start-server-and-test start http://localhost:9000 'playwright test --config src/test/webapp/component/playwright.config.ts'"))
+        .addScript(scriptKey("test:component"), scriptCommand("start-server-and-test dev http://localhost:9000 'playwright test --ui --config src/test/webapp/component/playwright.config.ts'"))
+        .addScript(scriptKey("test:component:headless"), scriptCommand("start-server-and-test dev http://localhost:9000 'playwright test --config src/test/webapp/component/playwright.config.ts'"))
         .and()
       .context()
         .put("reportSubDirectory", "component-tests")
diff --git a/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/modal/health-modal.component.spec.ts.mustache b/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/modal/health-modal.component.spec.ts.mustache
index 571a2cc20..db40e03f2 100644
--- a/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/modal/health-modal.component.spec.ts.mustache
+++ b/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/modal/health-modal.component.spec.ts.mustache
@@ -1,15 +1,24 @@
 import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
 import { MAT_DIALOG_DATA } from '@angular/material/dialog';
+import { of } from 'rxjs';
 
 import { HealthModalComponent } from './health-modal.component';
 
+class MatDialogMock {
+  open() {
+    return {
+      afterClosed: () => of(true),
+    };
+  }
+}
+
 describe('HealthModalComponent', () => {
   let comp: HealthModalComponent;
   let fixture: ComponentFixture<HealthModalComponent>;
 
   beforeEach(waitForAsync(() => {
     TestBed.configureTestingModule({
-      providers: [{ provide: MAT_DIALOG_DATA, useValue: {} }],
+      providers: [{ provide: MAT_DIALOG_DATA, useValue: MatDialogMock }],
     })
       .overrideTemplate(HealthModalComponent, '')
       .compileComponents();
diff --git a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.component.html.mustache b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.component.html.mustache
index 6913ccc08..d4d1b5fff 100644
--- a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.component.html.mustache
+++ b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.component.html.mustache
@@ -9,7 +9,7 @@
       <form class="login-form" (ngSubmit)="login()" [formGroup]="loginForm">
         <mat-form-field class="form-field-full-width" appearance="fill">
           <mat-label>Login</mat-label>
-          <input type="text" name="username" id="username" formControlName="username" matInput placeholder="Login" value="" />
+          <input type="text" name="username" id="username" formControlName="username" #username matInput placeholder="Login" value="" />
         </mat-form-field>
         <mat-form-field class="form-field-full-width" appearance="fill">
           <mat-label>Password</mat-label>
@@ -18,6 +18,7 @@
             name="password"
             id="password"
             formControlName="password"
+            #password
             matInput
             placeholder="Password"
             value=""


Test patch:
diff --git a/src/main/resources/generator/typescript/vitest.config.ts.mustache b/src/main/resources/generator/typescript/vitest.config.ts.mustache
index 17bea628c..8c7eb8ad2 100644
--- a/src/main/resources/generator/typescript/vitest.config.ts.mustache
+++ b/src/main/resources/generator/typescript/vitest.config.ts.mustache
@@ -29,7 +29,7 @@ export default defineConfig({
       },
       include: ['src/main/webapp/**/*.ts?(x)'],
       exclude: [
-        // keep this comment to be able to apply another front module after prettier format
+        // keep this comment to be able to apply other front module after prettier format
         ...(configDefaults.coverage.exclude as string[]),
       ],
       provider: 'istanbul',
diff --git a/src/test/java/tech/jhipster/lite/generator/client/angular/security/jwt/domain/AngularJwtModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/angular/security/jwt/domain/AngularJwtModuleFactoryTest.java
index 8eed32172..bf38fc7cb 100644
--- a/src/test/java/tech/jhipster/lite/generator/client/angular/security/jwt/domain/AngularJwtModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/client/angular/security/jwt/domain/AngularJwtModuleFactoryTest.java
@@ -50,7 +50,6 @@ class AngularJwtModuleFactoryTest {
           {
             path: '',
             loadComponent: () => import('./login/login.component'),
-            title: 'Login',
           },
         """
       );
diff --git a/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java
index 3fc0412f8..8dd111311 100644
--- a/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java
@@ -38,13 +38,13 @@ class CypressModuleFactoryTest {
         .containing(
           nodeScript(
             "test:component",
-            "start-server-and-test start http://localhost:9000 'cypress open --e2e --config-file src/test/webapp/component/cypress-config.ts'"
+            "start-server-and-test dev http://localhost:9000 'cypress open --e2e --config-file src/test/webapp/component/cypress-config.ts'"
           )
         )
         .containing(
           nodeScript(
             "test:component:headless",
-            "start-server-and-test start http://localhost:9000 'cypress run --headless --config-file src/test/webapp/component/cypress-config.ts'"
+            "start-server-and-test dev http://localhost:9000 'cypress run --headless --config-file src/test/webapp/component/cypress-config.ts'"
           )
         )
         .and()
diff --git a/src/test/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactoryTest.java
index 618f29ebd..d7a70a145 100644
--- a/src/test/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/client/tools/playwright/domain/PlaywrightModuleFactoryTest.java
@@ -27,13 +27,13 @@ class PlaywrightModuleFactoryTest {
       .containing(
         nodeScript(
           "test:component",
-          "start-server-and-test start http://localhost:9000 'playwright test --ui --config src/test/webapp/component/playwright.config.ts'"
+          "start-server-and-test dev http://localhost:9000 'playwright test --ui --config src/test/webapp/component/playwright.config.ts'"
         )
       )
       .containing(
         nodeScript(
           "test:component:headless",
-          "start-server-and-test start http://localhost:9000 'playwright test --config src/test/webapp/component/playwright.config.ts'"
+          "start-server-and-test dev http://localhost:9000 'playwright test --config src/test/webapp/component/playwright.config.ts'"
         )
       )
       .and()
diff --git a/src/test/java/tech/jhipster/lite/module/domain/JHipsterModuleContextTest.java b/src/test/java/tech/jhipster/lite/module/domain/JHipsterModuleContextTest.java
index 22d53726e..549924c21 100644
--- a/src/test/java/tech/jhipster/lite/module/domain/JHipsterModuleContextTest.java
+++ b/src/test/java/tech/jhipster/lite/module/domain/JHipsterModuleContextTest.java
@@ -1,16 +1,25 @@
 package tech.jhipster.lite.module.domain;
 
-import static org.assertj.core.api.Assertions.assertThat;
-import static tech.jhipster.lite.module.domain.JHipsterModulesFixture.emptyModuleBuilder;
+import static org.assertj.core.api.Assertions.*;
+import static tech.jhipster.lite.module.domain.JHipsterModulesFixture.*;
 
 import java.util.Map;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import tech.jhipster.lite.Logs;
+import tech.jhipster.lite.LogsSpy;
+import tech.jhipster.lite.LogsSpyExtension;
 import tech.jhipster.lite.UnitTest;
 import tech.jhipster.lite.module.domain.javabuild.JavaBuildTool;
 
 @UnitTest
+@ExtendWith(LogsSpyExtension.class)
 class JHipsterModuleContextTest {
 
+  @Logs
+  @SuppressWarnings("unused")
+  private LogsSpy logs;
+
   @Test
   void shouldGetDefaultContext() {
     Map<String, Object> context = JHipsterModuleContext.builder(emptyModuleBuilder()).build().get();
diff --git a/src/test/resources/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.shouldBuildModuleWithStyle.vitest.config.ts.approved.txt b/src/test/resources/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.shouldBuildModuleWithStyle.vitest.config.ts.approved.txt
index da57ca470..997afac7e 100644
--- a/src/test/resources/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.shouldBuildModuleWithStyle.vitest.config.ts.approved.txt
+++ b/src/test/resources/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.shouldBuildModuleWithStyle.vitest.config.ts.approved.txt
@@ -30,7 +30,7 @@ export default defineConfig({
       },
       include: ['src/main/webapp/**/*.ts?(x)'],
       exclude: [
-        // keep this comment to be able to apply another front module after prettier format
+        // keep this comment to be able to apply other front module after prettier format
         ...(configDefaults.coverage.exclude as string[]),
         'src/main/webapp/app/injections.ts',
         'src/main/webapp/app/index.tsx',
diff --git a/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.vitest.config.ts.approved.txt b/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.vitest.config.ts.approved.txt
index 8adce04be..a97253440 100644
--- a/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.vitest.config.ts.approved.txt
+++ b/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.vitest.config.ts.approved.txt
@@ -30,7 +30,7 @@ export default defineConfig({
       },
       include: ['src/main/webapp/**/*.ts?(x)'],
       exclude: [
-        // keep this comment to be able to apply another front module after prettier format
+        // keep this comment to be able to apply other front module after prettier format
         ...(configDefaults.coverage.exclude as string[]),
         'src/main/webapp/app/main.ts',
         'src/main/webapp/app/injections.ts',