mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 09:22:36 +00:00
renaming session-manager to conversations
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
parent
d0c5e07f8a
commit
8632d33a36
4 changed files with 13 additions and 13 deletions
|
|
@ -74,7 +74,7 @@ jest.mock("@/components/chat-playground/chat", () => ({
|
|||
),
|
||||
}));
|
||||
|
||||
jest.mock("@/components/chat-playground/session-manager", () => ({
|
||||
jest.mock("@/components/chat-playground/conversations", () => ({
|
||||
SessionManager: jest.fn(({ selectedAgentId, onNewSession }) => (
|
||||
<div data-testid="session-manager">
|
||||
{selectedAgentId && (
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import type { TurnCreateParams } from "llama-stack-client/resources/agents/turn"
|
|||
import {
|
||||
SessionUtils,
|
||||
type ChatSession,
|
||||
} from "@/components/chat-playground/session-manager";
|
||||
} from "@/components/chat-playground/conversations";
|
||||
export default function ChatPlaygroundPage() {
|
||||
const [currentSession, setCurrentSession] = useState<ChatSession | null>(
|
||||
null
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from "react";
|
||||
import { render, screen, waitFor, act } from "@testing-library/react";
|
||||
import "@testing-library/jest-dom";
|
||||
import { SessionManager, SessionUtils } from "./session-manager";
|
||||
import { Conversations, SessionUtils } from "./conversations";
|
||||
import type { Message } from "@/components/chat-playground/chat-message";
|
||||
|
||||
interface ChatSession {
|
||||
|
|
@ -36,8 +36,8 @@ jest.mock("@/hooks/use-auth-client", () => ({
|
|||
}));
|
||||
|
||||
// Mock additional SessionUtils methods that are now being used
|
||||
jest.mock("./session-manager", () => {
|
||||
const actual = jest.requireActual("./session-manager");
|
||||
jest.mock("./conversations", () => {
|
||||
const actual = jest.requireActual("./conversations");
|
||||
return {
|
||||
...actual,
|
||||
SessionUtils: {
|
||||
|
|
@ -130,7 +130,7 @@ describe("SessionManager", () => {
|
|||
test("does not render when no agent is selected", async () => {
|
||||
const { container } = await act(async () => {
|
||||
return render(
|
||||
<SessionManager
|
||||
<Conversations
|
||||
selectedAgentId=""
|
||||
currentSession={null}
|
||||
onSessionChange={mockOnSessionChange}
|
||||
|
|
@ -149,7 +149,7 @@ describe("SessionManager", () => {
|
|||
|
||||
await act(async () => {
|
||||
render(
|
||||
<SessionManager
|
||||
<Conversations
|
||||
selectedAgentId="agent_123"
|
||||
currentSession={null}
|
||||
onSessionChange={mockOnSessionChange}
|
||||
|
|
@ -166,7 +166,7 @@ describe("SessionManager", () => {
|
|||
test("renders session selector when agent sessions are loaded", async () => {
|
||||
await act(async () => {
|
||||
render(
|
||||
<SessionManager
|
||||
<Conversations
|
||||
selectedAgentId="agent_123"
|
||||
currentSession={null}
|
||||
onSessionChange={mockOnSessionChange}
|
||||
|
|
@ -183,7 +183,7 @@ describe("SessionManager", () => {
|
|||
test("renders current session name when session is selected", async () => {
|
||||
await act(async () => {
|
||||
render(
|
||||
<SessionManager
|
||||
<Conversations
|
||||
selectedAgentId="agent_123"
|
||||
currentSession={mockSession}
|
||||
onSessionChange={mockOnSessionChange}
|
||||
|
|
@ -202,7 +202,7 @@ describe("SessionManager", () => {
|
|||
test("loads sessions from agent API on mount", async () => {
|
||||
await act(async () => {
|
||||
render(
|
||||
<SessionManager
|
||||
<Conversations
|
||||
selectedAgentId="agent_123"
|
||||
currentSession={mockSession}
|
||||
onSessionChange={mockOnSessionChange}
|
||||
|
|
@ -226,7 +226,7 @@ describe("SessionManager", () => {
|
|||
|
||||
await act(async () => {
|
||||
render(
|
||||
<SessionManager
|
||||
<Conversations
|
||||
selectedAgentId="agent_123"
|
||||
currentSession={mockSession}
|
||||
onSessionChange={mockOnSessionChange}
|
||||
|
|
@ -257,7 +257,7 @@ describe("SessionManager", () => {
|
|||
|
||||
await act(async () => {
|
||||
render(
|
||||
<SessionManager
|
||||
<Conversations
|
||||
selectedAgentId="agent_123"
|
||||
currentSession={mockSession}
|
||||
onSessionChange={mockOnSessionChange}
|
||||
|
|
@ -73,7 +73,7 @@ const generateSessionId = (): string => {
|
|||
return globalThis.crypto.randomUUID();
|
||||
};
|
||||
|
||||
export function SessionManager({
|
||||
export function Conversations({
|
||||
currentSession,
|
||||
onSessionChange,
|
||||
selectedAgentId,
|
||||
Loading…
Add table
Add a link
Reference in a new issue