diff --git a/plugins/cost-insights-common/src/types/Group.ts b/plugins/cost-insights-common/src/types/Group.ts
index b34cac083f..ad384abe7b 100644
--- a/plugins/cost-insights-common/src/types/Group.ts
+++ b/plugins/cost-insights-common/src/types/Group.ts
@@ -19,4 +19,5 @@
*/
export type Group = {
id: string;
+ name?: string;
};
diff --git a/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.test.tsx b/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.test.tsx
index 6da6286515..2e2131daff 100644
--- a/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.test.tsx
+++ b/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.test.tsx
@@ -32,6 +32,7 @@ const mockGroups: Group[] = [
},
{
id: 'test-group-3',
+ name: 'Test Group 3',
},
];
@@ -76,7 +77,7 @@ describe('', () => {
);
await userEvent.click(rendered.getByTestId('cost-insights-groups-tab'));
mockGroups.forEach(group =>
- expect(rendered.getByText(group.id)).toBeInTheDocument(),
+ expect(rendered.getByText(group.name ?? group.id)).toBeInTheDocument(),
);
});
});
diff --git a/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.tsx b/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.tsx
index 3bb3f14214..935184ee55 100644
--- a/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.tsx
+++ b/plugins/cost-insights/src/components/CostInsightsTabs/CostInsightsTabs.tsx
@@ -100,7 +100,7 @@ export const CostInsightsTabs = ({ groups }: CostInsightsTabsProps) => {
data-testid={g.id}
onClick={updateGroupFilterAndCloseMenu(g)}
>
- {g.id}
+ {g.name ?? g.id}
))}
diff --git a/plugins/cost-insights/src/example/client.ts b/plugins/cost-insights/src/example/client.ts
index a7a2a0e22f..a6aadedd09 100644
--- a/plugins/cost-insights/src/example/client.ts
+++ b/plugins/cost-insights/src/example/client.ts
@@ -52,7 +52,8 @@ export class ExampleCostInsightsClient implements CostInsightsApi {
async getUserGroups(userId: string): Promise {
const groups: Group[] = await this.request({ userId }, [
- { id: 'pied-piper' },
+ { id: 'group-a', name: 'Group A' },
+ { id: 'group-b', name: 'Group B' },
]);
return groups;