From d23542f77c08886b361b09c7366845b70ede4059 Mon Sep 17 00:00:00 2001
From: Yann Braga <yannbf@gmail.com>
Date: Tue, 1 Oct 2024 12:17:15 +0200
Subject: [PATCH] use exportName as fallback for test title instead

---
 code/core/src/csf-tools/vitest-plugin/transformer.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/code/core/src/csf-tools/vitest-plugin/transformer.ts b/code/core/src/csf-tools/vitest-plugin/transformer.ts
index 4a1f6cd763d3..677235975cb1 100644
--- a/code/core/src/csf-tools/vitest-plugin/transformer.ts
+++ b/code/core/src/csf-tools/vitest-plugin/transformer.ts
@@ -245,7 +245,7 @@ export async function vitestTransform({
 
         const localName = parsed._stories[exportName].localName ?? exportName;
         // use the story's name as the test title for vitest, and fallback to exportName
-        const testTitle = parsed._stories[exportName].name ?? localName;
+        const testTitle = parsed._stories[exportName].name ?? exportName;
         return getTestStatementForStory({ testTitle, localName, exportName, node });
       })
       .filter((st) => !!st) as t.ExpressionStatement[];