You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by yo...@apache.org on 2026/10/17 00:22:45 UTC

(zeppelin) 14/17: [ZEPPELIN-6747] Fill the Assistant conversation fixtures from the master contract

This is an automated email from the ASF dual-hosted git repository.

voidmatcha pushed a commit to branch branch-voidmatcha-assistant-integration-temp
in repository https://gitbox.apache.org/repos/asf/zeppelin.git

commit bfbb0abb5ee81a1f95fe64c015369affac16e515
Author: YONGJAE LEE <de...@gmail.com>
AuthorDate: Sat Oct 17 09:21:34 2026 +0900

    [ZEPPELIN-6747] Fill the Assistant conversation fixtures from the master contract
---
 .../assistant/ui/ConversationHeader.spec.tsx       | 24 +++++++++++--
 .../assistant/ui/ConversationHeader.stories.tsx    | 16 +++++++--
 .../assistant/ui/ConversationList.spec.tsx         | 40 +++++++++++++++++++---
 .../assistant/ui/ConversationList.stories.tsx      | 17 +++++++--
 4 files changed, 85 insertions(+), 12 deletions(-)

diff --git a/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationHeader.spec.tsx b/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationHeader.spec.tsx
index bda08d1065..3ade34aa79 100644
--- a/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationHeader.spec.tsx
+++ b/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationHeader.spec.tsx
@@ -19,7 +19,13 @@ const noop = () => {};
 
 describe('ConversationHeader', () => {
   it('shows the selected conversation title', () => {
-    const conversation: AssistantConversation = { id: 'a', title: 'Explain revenue by region' };
+    const conversation: AssistantConversation = {
+      id: 'a',
+      ownerId: 'user1',
+      title: 'Explain revenue by region',
+      canSendMessage: true,
+      updatedAt: '2026-10-15T02:00:00.000Z'
+    };
     render(<ConversationHeader conversation={conversation} onCreate={noop} onDelete={noop} />);
     expect(screen.getByText('Explain revenue by region')).toBeTruthy();
   });
@@ -30,14 +36,26 @@ describe('ConversationHeader', () => {
   });
 
   it('offers no delete button for a read-only conversation', () => {
-    const conversation: AssistantConversation = { id: 'a', title: 'Shared', canSendMessage: false };
+    const conversation: AssistantConversation = {
+      id: 'a',
+      ownerId: 'user1',
+      title: 'Shared',
+      canSendMessage: false,
+      updatedAt: '2026-10-15T02:00:00.000Z'
+    };
     render(<ConversationHeader conversation={conversation} onCreate={noop} onDelete={noop} />);
     expect(screen.queryByRole('button', { name: 'Delete Shared' })).toBeNull();
   });
 
   it('reports the deleted conversation id without asking for confirmation', () => {
     const onDelete = vi.fn();
-    const conversation: AssistantConversation = { id: 'a', title: 'Explain revenue by region' };
+    const conversation: AssistantConversation = {
+      id: 'a',
+      ownerId: 'user1',
+      title: 'Explain revenue by region',
+      canSendMessage: true,
+      updatedAt: '2026-10-15T02:00:00.000Z'
+    };
     render(<ConversationHeader conversation={conversation} onCreate={noop} onDelete={onDelete} />);
     fireEvent.click(screen.getByRole('button', { name: 'Delete Explain revenue by region' }));
     expect(onDelete).toHaveBeenCalledWith('a');
diff --git a/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationHeader.stories.tsx b/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationHeader.stories.tsx
index 83e3de509d..d469e3672d 100644
--- a/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationHeader.stories.tsx
+++ b/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationHeader.stories.tsx
@@ -15,8 +15,20 @@ import { fn } from 'storybook/test';
 import type { AssistantConversation } from '../model/assistantContract';
 import { ConversationHeader } from './ConversationHeader';
 
-const current: AssistantConversation = { id: 'a', title: 'Explain how the notebook calculates revenue' };
-const readOnly: AssistantConversation = { id: 'b', title: 'Compare regional totals', canSendMessage: false };
+const current: AssistantConversation = {
+  id: 'a',
+  ownerId: 'user1',
+  title: 'Explain how the notebook calculates revenue',
+  canSendMessage: true,
+  updatedAt: '2026-10-15T02:00:00.000Z'
+};
+const readOnly: AssistantConversation = {
+  id: 'b',
+  ownerId: 'user1',
+  title: 'Compare regional totals',
+  canSendMessage: false,
+  updatedAt: '2026-10-15T02:00:00.000Z'
+};
 
 const meta = {
   title: 'Assistant/ConversationHeader',
diff --git a/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationList.spec.tsx b/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationList.spec.tsx
index 6909e74eb1..2e9a3ca77e 100644
--- a/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationList.spec.tsx
+++ b/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationList.spec.tsx
@@ -18,9 +18,27 @@ import { ConversationList } from './ConversationList';
 const NOW = new Date(2026, 9, 15, 12).getTime();
 
 const conversations: AssistantConversation[] = [
-  { id: 'a', title: 'Explain revenue by region', updatedAt: new Date(2026, 9, 15, 11).toISOString() },
-  { id: 'b', title: 'Draft a query', updatedAt: new Date(2026, 9, 10, 9).toISOString() },
-  { id: 'c', title: 'Shared analysis', canSendMessage: false, updatedAt: new Date(2026, 9, 9, 9).toISOString() }
+  {
+    id: 'a',
+    ownerId: 'user1',
+    title: 'Explain revenue by region',
+    updatedAt: new Date(2026, 9, 15, 11).toISOString(),
+    canSendMessage: true
+  },
+  {
+    id: 'b',
+    ownerId: 'user1',
+    title: 'Draft a query',
+    updatedAt: new Date(2026, 9, 10, 9).toISOString(),
+    canSendMessage: true
+  },
+  {
+    id: 'c',
+    ownerId: 'user1',
+    title: 'Shared analysis',
+    canSendMessage: false,
+    updatedAt: new Date(2026, 9, 9, 9).toISOString()
+  }
 ];
 
 const noop = () => {};
@@ -193,8 +211,20 @@ describe('ConversationList', () => {
     render(
       <ConversationList
         conversations={[
-          { id: 'x', title: 'After midnight', updatedAt: new Date(2026, 9, 15, 0, 1).toISOString() },
-          { id: 'y', title: 'Before midnight', updatedAt: new Date(2026, 9, 14, 23, 59).toISOString() }
+          {
+            id: 'x',
+            ownerId: 'user1',
+            title: 'After midnight',
+            updatedAt: new Date(2026, 9, 15, 0, 1).toISOString(),
+            canSendMessage: true
+          },
+          {
+            id: 'y',
+            ownerId: 'user1',
+            title: 'Before midnight',
+            updatedAt: new Date(2026, 9, 14, 23, 59).toISOString(),
+            canSendMessage: true
+          }
         ]}
         onSelect={noop}
         onCreate={noop}
diff --git a/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationList.stories.tsx b/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationList.stories.tsx
index cdfda369a2..508ea5082f 100644
--- a/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationList.stories.tsx
+++ b/zeppelin-web-angular/projects/zeppelin-react/src/entities/assistant/ui/ConversationList.stories.tsx
@@ -18,10 +18,23 @@ import { ConversationList } from './ConversationList';
 const NOW = new Date(2026, 9, 15, 12).getTime();
 
 const conversations: AssistantConversation[] = [
-  { id: 'a', title: 'Explain revenue by region', updatedAt: new Date(2026, 9, 15, 11).toISOString() },
-  { id: 'b', title: 'Draft a query for monthly orders', updatedAt: new Date(2026, 9, 10, 9).toISOString() },
+  {
+    id: 'a',
+    ownerId: 'user1',
+    title: 'Explain revenue by region',
+    updatedAt: new Date(2026, 9, 15, 11).toISOString(),
+    canSendMessage: true
+  },
+  {
+    id: 'b',
+    ownerId: 'user1',
+    title: 'Draft a query for monthly orders',
+    updatedAt: new Date(2026, 9, 10, 9).toISOString(),
+    canSendMessage: true
+  },
   {
     id: 'c',
+    ownerId: 'user2',
     title: 'Review shared analysis',
     canSendMessage: false,
     updatedAt: new Date(2026, 9, 9, 9).toISOString()