diff --git a/plugins/xcmetrics/src/api/XCMetricsClient.ts b/plugins/xcmetrics/src/api/XCMetricsClient.ts index f89cf00123..00087ad75d 100644 --- a/plugins/xcmetrics/src/api/XCMetricsClient.ts +++ b/plugins/xcmetrics/src/api/XCMetricsClient.ts @@ -16,13 +16,13 @@ import { DiscoveryApi } from '@backstage/core-plugin-api'; import { ResponseError } from '@backstage/errors'; -import { BuildItem, BuildsResult, XCMetricsApi } from './types'; +import { BuildItem, BuildsResult, XcmetricsApi } from './types'; interface Options { discoveryApi: DiscoveryApi; } -export class XCMetricsClient implements XCMetricsApi { +export class XcmetricsClient implements XcmetricsApi { private readonly discoveryApi: DiscoveryApi; constructor(options: Options) { diff --git a/plugins/xcmetrics/src/api/index.ts b/plugins/xcmetrics/src/api/index.ts index f3483ca443..c184dc950d 100644 --- a/plugins/xcmetrics/src/api/index.ts +++ b/plugins/xcmetrics/src/api/index.ts @@ -15,4 +15,4 @@ */ export * from './types'; -export * from './XCMetricsClient'; +export * from './XcmetricsClient'; diff --git a/plugins/xcmetrics/src/api/types.ts b/plugins/xcmetrics/src/api/types.ts index 5df05f0375..add59b1a86 100644 --- a/plugins/xcmetrics/src/api/types.ts +++ b/plugins/xcmetrics/src/api/types.ts @@ -53,11 +53,11 @@ export type BuildsResult = { }; }; -export interface XCMetricsApi { +export interface XcmetricsApi { getBuilds(): Promise; } -export const xcmetricsApiRef = createApiRef({ +export const xcmetricsApiRef = createApiRef({ id: 'plugin.xcmetrics.api', description: 'Used by the XCMetrics plugin to make requests', }); diff --git a/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.test.tsx b/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.test.tsx index d92ec1cbc0..d386d279ce 100644 --- a/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.test.tsx +++ b/plugins/xcmetrics/src/components/OverviewComponent/OverviewComponent.test.tsx @@ -16,13 +16,13 @@ import React from 'react'; import { OverviewComponent } from './OverviewComponent'; import { renderInTestApp } from '@backstage/test-utils'; -import { XCMetricsApi, xcmetricsApiRef } from '../../api'; +import { XcmetricsApi, xcmetricsApiRef } from '../../api'; import { ApiProvider, ApiRegistry } from '@backstage/core-app-api'; describe('OverviewComponent', () => { it('should render', async () => { const mockUserId = 'mockUser'; - const mockApi: jest.Mocked = { + const mockApi: jest.Mocked = { getBuilds: jest.fn().mockResolvedValue([ { userid: mockUserId, @@ -47,7 +47,7 @@ describe('OverviewComponent', () => { }); it('should render an empty state when no builds exist', async () => { - const mockApi: jest.Mocked = { + const mockApi: jest.Mocked = { getBuilds: jest.fn().mockResolvedValue([]), }; @@ -61,7 +61,7 @@ describe('OverviewComponent', () => { it('should show an error when API not responding', async () => { const errorMessage = 'MockErrorMessage'; - const mockApi: jest.Mocked = { + const mockApi: jest.Mocked = { getBuilds: jest.fn().mockRejectedValue({ message: errorMessage }), }; diff --git a/plugins/xcmetrics/src/components/XCMetricsPage/XCMetricsPage.tsx b/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx similarity index 96% rename from plugins/xcmetrics/src/components/XCMetricsPage/XCMetricsPage.tsx rename to plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx index 0c1b1d1dde..96d841b083 100644 --- a/plugins/xcmetrics/src/components/XCMetricsPage/XCMetricsPage.tsx +++ b/plugins/xcmetrics/src/components/XcmetricsLayout/XcmetricsLayout.tsx @@ -17,7 +17,7 @@ import React from 'react'; import { Content, Header, HeaderLabel, Page } from '@backstage/core-components'; import { OverviewComponent } from '../OverviewComponent'; -export const XCMetricsPage = () => ( +export const XcmetricsLayout = () => (
diff --git a/plugins/xcmetrics/src/components/XCMetricsPage/index.ts b/plugins/xcmetrics/src/components/XcmetricsLayout/index.ts similarity index 94% rename from plugins/xcmetrics/src/components/XCMetricsPage/index.ts rename to plugins/xcmetrics/src/components/XcmetricsLayout/index.ts index 2ffdb84d40..eaaadcbaea 100644 --- a/plugins/xcmetrics/src/components/XCMetricsPage/index.ts +++ b/plugins/xcmetrics/src/components/XcmetricsLayout/index.ts @@ -13,4 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export * from './XCMetricsPage'; +export * from './XcmetricsLayout'; diff --git a/plugins/xcmetrics/src/plugin.ts b/plugins/xcmetrics/src/plugin.ts index d01392a110..22250ff627 100644 --- a/plugins/xcmetrics/src/plugin.ts +++ b/plugins/xcmetrics/src/plugin.ts @@ -19,7 +19,7 @@ import { createRoutableExtension, discoveryApiRef, } from '@backstage/core-plugin-api'; -import { xcmetricsApiRef, XCMetricsClient } from './api'; +import { xcmetricsApiRef, XcmetricsClient } from './api'; import { rootRouteRef } from './routes'; export const xcmetricsPlugin = createPlugin({ @@ -34,7 +34,7 @@ export const xcmetricsPlugin = createPlugin({ discoveryApi: discoveryApiRef, }, factory({ discoveryApi }) { - return new XCMetricsClient({ discoveryApi }); + return new XcmetricsClient({ discoveryApi }); }, }), ], @@ -43,7 +43,7 @@ export const xcmetricsPlugin = createPlugin({ export const XcmetricsPage = xcmetricsPlugin.provide( createRoutableExtension({ component: () => - import('./components/XCMetricsPage').then(m => m.XCMetricsPage), + import('./components/XcmetricsLayout').then(m => m.XcmetricsLayout), mountPoint: rootRouteRef, }), );