Repository: jhipster/jhipster-lite
Pull request #12316 (2025-04-13 13:42:17)

React: standardize extension for tests files
Same as https://github.com/jhipster/jhipster-lite/blob/05bd6cf59d1404f90985934da16cc76024d8e578/src/main/resources/generator/client/react/core/src/test/webapp/unit/home/infrastructure/primary/HomePage.spec.tsx.mustache#L1


Patch:
diff --git a/src/main/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactory.java
index 9f455f96c..6f9f34506 100644
--- a/src/main/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactory.java
@@ -75,16 +75,16 @@ public class ReactJwtModuleFactory {
           .addTemplate("LoginModal.scss")
           .and()
         .add(APP_SOURCE.template("login/services/login.ts"), APP_DESTINATION.append("login/services/login.ts"))
-        .add(TEST_JAVASCRIPT_SOURCE.template("login/services/login.test.ts"), TEST_DESTINATION.append("login/services/login.test.ts"))
+        .add(TEST_JAVASCRIPT_SOURCE.template("login/services/login.spec.ts"), TEST_DESTINATION.append("login/services/login.spec.ts"))
         .add(
-          TEST_JAVASCRIPT_SOURCE.template("login/primary/loginForm/index.test.tsx"),
-          TEST_DESTINATION.append("login/primary/loginForm/index.test.tsx")
+          TEST_JAVASCRIPT_SOURCE.template("login/primary/loginForm/index.spec.tsx"),
+          TEST_DESTINATION.append("login/primary/loginForm/index.spec.tsx")
         )
         .add(
-          TEST_JAVASCRIPT_SOURCE.template("login/primary/loginModal/index.test.tsx"),
-          TEST_DESTINATION.append("login/primary/loginModal/index.test.tsx")
+          TEST_JAVASCRIPT_SOURCE.template("login/primary/loginModal/index.spec.tsx"),
+          TEST_DESTINATION.append("login/primary/loginModal/index.spec.tsx")
         )
-        .add(TEST_JAVASCRIPT_SOURCE.template("common/services/storage.test.ts"), TEST_DESTINATION.append("common/services/storage.test.ts"))
+        .add(TEST_JAVASCRIPT_SOURCE.template("common/services/storage.spec.ts"), TEST_DESTINATION.append("common/services/storage.spec.ts"))
         .and()
       .mandatoryReplacements()
         .in(path("src/main/webapp/app/home/infrastructure/primary/HomePage.tsx"))


Test patch:
diff --git a/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/common/services/storage.test.ts.mustache b/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/common/services/storage.spec.ts.mustache
similarity index 100%
rename from src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/common/services/storage.test.ts.mustache
rename to src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/common/services/storage.spec.ts.mustache
diff --git a/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/primary/loginForm/index.test.tsx.mustache b/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/primary/loginForm/index.spec.tsx.mustache
similarity index 100%
rename from src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/primary/loginForm/index.test.tsx.mustache
rename to src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/primary/loginForm/index.spec.tsx.mustache
diff --git a/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/primary/loginModal/index.test.tsx.mustache b/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/primary/loginModal/index.spec.tsx.mustache
similarity index 100%
rename from src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/primary/loginModal/index.test.tsx.mustache
rename to src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/primary/loginModal/index.spec.tsx.mustache
diff --git a/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/services/login.test.ts.mustache b/src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/services/login.spec.ts.mustache
similarity index 100%
rename from src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/services/login.test.ts.mustache
rename to src/main/resources/generator/client/react/security/jwt/src/test/webapp/unit/login/services/login.spec.ts.mustache
diff --git a/src/test/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactoryTest.java
index 1a0c43269..42118d556 100644
--- a/src/test/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/client/react/security/jwt/domain/ReactJwtModuleFactoryTest.java
@@ -95,10 +95,10 @@ class ReactJwtModuleFactoryTest {
       )
       .hasPrefixedFiles(
         "src/test/webapp/unit",
-        "login/services/login.test.ts",
-        "login/primary/loginForm/index.test.tsx",
-        "login/primary/loginModal/index.test.tsx",
-        "common/services/storage.test.ts"
+        "login/services/login.spec.ts",
+        "login/primary/loginForm/index.spec.tsx",
+        "login/primary/loginModal/index.spec.tsx",
+        "common/services/storage.spec.ts"
       )
       .hasFile("src/main/webapp/app/home/infrastructure/primary/HomePage.tsx")
       .containing("import LoginForm from '@/login/primary/loginForm';")