From 1cf7f20cdc0c60326a24049c4ae348eb3d56ab96 Mon Sep 17 00:00:00 2001 From: Daniel Bernstein Date: Fri, 22 Dec 2023 12:43:40 -0800 Subject: [PATCH] Add jest test --- src/components/QuicksightDashboard.tsx | 5 +- .../components/QuicksightDashboard.test.tsx | 51 +++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 tests/jest/components/QuicksightDashboard.test.tsx diff --git a/src/components/QuicksightDashboard.tsx b/src/components/QuicksightDashboard.tsx index 44203004b..d29ae59d0 100644 --- a/src/components/QuicksightDashboard.tsx +++ b/src/components/QuicksightDashboard.tsx @@ -28,7 +28,7 @@ export interface QuicksightDashboardState { embedUrl: string; } -export class QuicksightDashboard extends React.Component< +class QuicksightDashboard extends React.Component< QuicksightDashboardProps, QuicksightDashboardState > { @@ -43,7 +43,7 @@ export class QuicksightDashboard extends React.Component< this.props.fetchLibraries().then((libs) => { const library_uuids: string = libs.libraries - .slice(0, 5) + .slice(0, Math.min(1, 10))// TODO: remove this once https://github.com/ThePalaceProject/circulation/pull/1577 is merged .map((l) => l.uuid) .join(","); try { @@ -67,6 +67,7 @@ export class QuicksightDashboard extends React.Component< render(): JSX.Element { return (