- {artifact.name ||
- artifact.customPropertiesMap.find(([name]) => name === 'display_name')?.[1].stringValue}
+
+ {getArtifactName(artifact)}
+
|
{artifact.id} |
{artifact.type} |
-
-
-
-
-
-
-
-
-
-
-
+
|
|
),
- [],
+ [namespace],
);
return (
diff --git a/frontend/src/pages/pipelines/global/experiments/artifacts/__tests__/ArtifactDetails.spec.tsx b/frontend/src/pages/pipelines/global/experiments/artifacts/__tests__/ArtifactDetails.spec.tsx
new file mode 100644
index 0000000000..8873489db8
--- /dev/null
+++ b/frontend/src/pages/pipelines/global/experiments/artifacts/__tests__/ArtifactDetails.spec.tsx
@@ -0,0 +1,143 @@
+import React from 'react';
+import { BrowserRouter } from 'react-router-dom';
+
+import { render, screen, within } from '@testing-library/react';
+import '@testing-library/jest-dom';
+
+import { Artifact } from '~/third_party/mlmd';
+import { artifactsBaseRoute } from '~/routes';
+import * as useGetArtifactById from '~/pages/pipelines/global/experiments/artifacts/useGetArtifactById';
+import { ArtifactDetails } from '~/pages/pipelines/global/experiments/artifacts/ArtifactDetails';
+import GlobalPipelineCoreDetails from '~/pages/pipelines/global/GlobalPipelineCoreDetails';
+
+jest.mock('~/redux/selectors', () => ({
+ ...jest.requireActual('~/redux/selectors'),
+ useUser: jest.fn(() => ({ isAdmin: true })),
+}));
+
+jest.mock('~/concepts/pipelines/context/PipelinesContext', () => ({
+ usePipelinesAPI: jest.fn(() => ({
+ pipelinesServer: {
+ initializing: false,
+ installed: true,
+ compatible: true,
+ timedOut: false,
+ name: 'dspa',
+ },
+ namespace: 'Test namespace',
+ project: {
+ metadata: {
+ name: 'Test namespace',
+ },
+ kind: 'Project',
+ },
+ apiAvailable: true,
+ })),
+}));
+
+describe('ArtifactDetails', () => {
+ const useGetArtifactByIdSpy = jest.spyOn(useGetArtifactById, 'useGetArtifactById');
+
+ beforeEach(() => {
+ useGetArtifactByIdSpy.mockReturnValue([
+ {
+ toObject: jest.fn(() => ({
+ id: 1,
+ typeId: 14,
+ type: 'system.Artifact',
+ uri: 'https://test-artifact!-aiplatform.googleapis.com/v1/12.15',
+ propertiesMap: [],
+ customPropertiesMap: [
+ [
+ 'display_name',
+ {
+ stringValue: 'vertex_model',
+ },
+ ],
+ [
+ 'resourceName',
+ {
+ stringValue: '12.15',
+ },
+ ],
+ ],
+ state: 2,
+ createTimeSinceEpoch: 1711113121829,
+ lastUpdateTimeSinceEpoch: 1711113121829,
+ })),
+ } as unknown as Artifact,
+ true,
+ undefined,
+ jest.fn(),
+ ]);
+ });
+
+ it('renders page breadcrumbs', () => {
+ render(
+