Skip to content
Source
Sign inSign up
pingdotgg/t3code

Improve markdown file link UX #1956

Mergedjustsomelegs(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/1956/headmerged by juliusmarminge View on GitHub

Showing 10 changed files with 189 additions and 0 deletions (loading 9).

x
0 of 10 viewed, 10 left
189 additions and 0 deletionsapps/web/src/components/chat/MessagesTimeline.test.tsxAdded
View file
@@ -0,0 +1,189 @@
+import { EnvironmentId, MessageId } from "@t3tools/contracts";
+import { createRef } from "react";
+import { renderToStaticMarkup } from "react-dom/server";
+import { beforeAll, describe, expect, it, vi } from "vitest";
+import type { LegendListRef } from "@legendapp/list/react";
+​
+vi.mock("@legendapp/list/react", async () => {
+ const React = await import("react");
+​
+ const LegendList = React.forwardRef(function MockLegendList(
+ props: {
+ data: Array<{ id: string }>;
+ keyExtractor: (item: { id: string }) => string;
+ renderItem: (args: { item: { id: string } }) => React.ReactNode;
+ ListHeaderComponent?: React.ReactNode;
+ ListFooterComponent?: React.ReactNode;
+ },
+ _ref: React.ForwardedRef<LegendListRef>,
+ ) {
+ return (
+ <div data-testid="legend-list">
+ {props.ListHeaderComponent}
+ {props.data.map((item) => (
+ <div key={props.keyExtractor(item)}>{props.renderItem({ item })}</div>
+ ))}
+ {props.ListFooterComponent}
+ </div>
+ );
+ });
+​