Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/src/components/LibraryCard.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ describe('LibraryCard', () => {
expect(screen.getByText('matplotlib')).toBeInTheDocument();
});

it('renders the description for a javascript library', () => {
render(<LibraryCard name="echarts" language="javascript" onClick={vi.fn()} />);
expect(screen.getByText(/Powerful interactive charts for the browser/i)).toBeInTheDocument();
});

it('renders the language chip in the corner when language is provided', () => {
render(<LibraryCard name="ggplot2" language="r" onClick={vi.fn()} />);
expect(screen.getByLabelText('Language: R')).toHaveTextContent('R');
Expand Down
3 changes: 3 additions & 0 deletions app/src/components/LibraryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const DESCRIPTIONS: Record<string, string> = {
letsplot: 'Grammar of graphics by JetBrains. Interactive.',
ggplot2: 'The reference grammar of graphics. R’s expressive plotting standard.',
makie: 'High-performance Julia visualization. CairoMakie ships publication-quality static charts.',
chartjs: 'Simple, flexible HTML5-canvas charts. The popular JS default.',
d3: 'Data-driven SVG. Low-level, maximum control on the web.',
echarts: 'Powerful interactive charts for the browser. Vast chart catalog.',
};

interface LibraryCardProps {
Expand Down
Loading