diff --git a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx index e3de9593d9..ca438b75ac 100644 --- a/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx +++ b/plugins/cost-insights/src/components/CostOverviewCard/CostOverviewCard.test.tsx @@ -30,6 +30,7 @@ import { MockScrollProvider, } from '../../testUtils'; import { CostInsightsThemeProvider } from '../CostInsightsPage/CostInsightsThemeProvider'; +import { createPlugin, PluginProvider } from '@backstage/core-plugin-api'; const mockGroupDailyCost: Cost = { id: 'test-group', @@ -38,13 +39,30 @@ const mockGroupDailyCost: Cost = { trendline: trendlineOf(MockAggregatedDailyCosts), }; +type TestInputPluginOptions = { + showTrendLine: boolean; +}; + +type TestPluginOptions = { + showTrendLine: boolean; +}; + +const plugin = createPlugin({ + id: 'my-plugin', + __experimentalConfigure(_: TestInputPluginOptions): TestPluginOptions { + return { showTrendLine: false }; + }, +}); + function renderInContext(children: JSX.Element) { return renderInTestApp( - {children} + + {children} + diff --git a/plugins/cost-insights/src/components/EntityCosts/EntityCost.test.tsx b/plugins/cost-insights/src/components/EntityCosts/EntityCost.test.tsx index 53e1a13ebf..e2b6a28247 100644 --- a/plugins/cost-insights/src/components/EntityCosts/EntityCost.test.tsx +++ b/plugins/cost-insights/src/components/EntityCosts/EntityCost.test.tsx @@ -32,6 +32,7 @@ import { EntityProvider } from '@backstage/plugin-catalog-react'; import { Entity } from '@backstage/catalog-model'; import { LoadingProvider } from '../../hooks'; import { Cost } from '@backstage/plugin-cost-insights-common'; +import { createPlugin, PluginProvider } from '@backstage/core-plugin-api'; function renderInContext(children: JSX.Element) { const mockEntity = { @@ -56,6 +57,21 @@ function renderInContext(children: JSX.Element) { getAlerts: jest.fn().mockResolvedValue({}), }; + type TestInputPluginOptions = { + showTrendLine: boolean; + }; + + type TestPluginOptions = { + showTrendLine: boolean; + }; + + const plugin = createPlugin({ + id: 'my-plugin', + __experimentalConfigure(_: TestInputPluginOptions): TestPluginOptions { + return { showTrendLine: false }; + }, + }); + return renderInTestApp( @@ -64,7 +80,9 @@ function renderInContext(children: JSX.Element) { - {children} + + {children} +