mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2026-01-04 22:24:22 +01:00
feat(e2e): enhance end-to-end testing setup with new scripts and capture cases
- Updated package.json to include new E2E scripts for execution and snapshot capturing. - Added new capture cases for the "new-project-modal" and "start-new-chat" functionalities in the E2E tests. - Increased wait times in session detail captures to ensure elements are fully loaded before interactions. - Introduced new shell scripts for starting the server and capturing snapshots, improving the E2E testing workflow. - Updated NewChatModal and SessionsTab components to include data-testid attributes for better test targeting.
This commit is contained in:
@@ -12,7 +12,7 @@ import { NewChat } from "./NewChat";
|
||||
|
||||
export const NewChatModal: FC<{
|
||||
projectId: string;
|
||||
trigger?: ReactNode;
|
||||
trigger: ReactNode;
|
||||
}> = ({ projectId, trigger }) => {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
@@ -22,15 +22,11 @@ export const NewChatModal: FC<{
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogTrigger asChild>
|
||||
{trigger ?? (
|
||||
<Button className="gap-2">
|
||||
<PlusIcon className="w-4 h-4" />
|
||||
New Chat
|
||||
</Button>
|
||||
)}
|
||||
</DialogTrigger>
|
||||
<DialogContent className="w-[95vw] md:w-[80vw]">
|
||||
<DialogTrigger asChild>{trigger}</DialogTrigger>
|
||||
<DialogContent
|
||||
className="w-[95vw] md:w-[80vw]"
|
||||
data-testid="start-new-chat-modal"
|
||||
>
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<MessageSquareIcon className="w-5 h-5" />
|
||||
|
||||
@@ -204,6 +204,7 @@ export const SessionPageContent: FC<{
|
||||
<div
|
||||
ref={scrollContainerRef}
|
||||
className="flex-1 overflow-y-auto min-h-0 min-w-0"
|
||||
data-testid="scrollable-content"
|
||||
>
|
||||
<main className="w-full px-4 sm:px-6 md:px-8 lg:px-12 xl:px-16 relative z-5 min-w-0">
|
||||
<ConversationList
|
||||
|
||||
@@ -98,6 +98,7 @@ export const MobileSidebar: FC<MobileSidebarProps> = ({
|
||||
hasNextPage={hasNextPage}
|
||||
isFetchingNextPage={isFetchingNextPage}
|
||||
onLoadMore={() => fetchNextPage()}
|
||||
isMobile={true}
|
||||
/>
|
||||
);
|
||||
case "mcp":
|
||||
|
||||
@@ -19,6 +19,7 @@ export const SessionsTab: FC<{
|
||||
hasNextPage?: boolean;
|
||||
isFetchingNextPage?: boolean;
|
||||
onLoadMore?: () => void;
|
||||
isMobile?: boolean;
|
||||
}> = ({
|
||||
sessions,
|
||||
currentSessionId,
|
||||
@@ -26,6 +27,7 @@ export const SessionsTab: FC<{
|
||||
hasNextPage,
|
||||
isFetchingNextPage,
|
||||
onLoadMore,
|
||||
isMobile = false,
|
||||
}) => {
|
||||
const sessionProcesses = useAtomValue(sessionProcessesAtom);
|
||||
|
||||
@@ -70,7 +72,16 @@ export const SessionsTab: FC<{
|
||||
<NewChatModal
|
||||
projectId={projectId}
|
||||
trigger={
|
||||
<Button size="sm" variant="outline" className="gap-1.5">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="gap-1.5"
|
||||
data-testid={
|
||||
isMobile === true
|
||||
? "start-new-chat-button-mobile"
|
||||
: "start-new-chat-button"
|
||||
}
|
||||
>
|
||||
<PlusIcon className="w-3.5 h-3.5" />
|
||||
New
|
||||
</Button>
|
||||
|
||||
@@ -52,12 +52,12 @@ export const CreateProjectDialog: FC = () => {
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={setOpen}>
|
||||
<DialogTrigger asChild>
|
||||
<Button>
|
||||
<Button data-testid="new-project-button">
|
||||
<Plus className="w-4 h-4 mr-2" />
|
||||
New Project
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="max-w-2xl">
|
||||
<DialogContent className="max-w-2xl" data-testid="new-project-modal">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Create New Project</DialogTitle>
|
||||
<DialogDescription>
|
||||
|
||||
Reference in New Issue
Block a user