Skip to content

Commit

Permalink
test(landcoverexplorer): add data-testid attr to total-area-graph
Browse files Browse the repository at this point in the history
  • Loading branch information
vannizhang committed Mar 29, 2024
1 parent 0947723 commit 36dc811
Showing 1 changed file with 32 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ const TotalAreaGraph: FC<Props> = ({ data, itemOnHover }: Props) => {
);
}

if (!data.length) {
return (
<div className="w-full text-center">
<p className="text-sm opacity-50 mt-12">
Failed to fetch Land Cover data.
</p>
</div>
);
}

return (
// <BarChart
// data4Bars={data}
Expand All @@ -50,24 +60,28 @@ const TotalAreaGraph: FC<Props> = ({ data, itemOnHover }: Props) => {
// showXAxisLine={true}
// // itemOnHover={itemOnHover}
// />

<BarChartBasic
data={data}
showStickyLabelText={true}
leftAxisOptions={{
shouldHide: true,
}}
bottomAxisOptions={{
shouldRotateTextLabels: true,
}}
innerPadding={0.4}
margin={{
top: 35,
right: 10,
bottom: 50,
left: 20,
}}
/>
<div
className="relative w-full h-full"
data-testid="total-area-graph"
>
<BarChartBasic
data={data}
showStickyLabelText={true}
leftAxisOptions={{
shouldHide: true,
}}
bottomAxisOptions={{
shouldRotateTextLabels: true,
}}
innerPadding={0.4}
margin={{
top: 35,
right: 10,
bottom: 50,
left: 20,
}}
/>
</div>
);
};

Expand Down

0 comments on commit 36dc811

Please sign in to comment.