Skip to content

Instantly share code, notes, and snippets.

@larkintuckerllc
Created March 6, 2022 12:20
Show Gist options
  • Save larkintuckerllc/3e048ae8b870e0ad260ff07d7971df33 to your computer and use it in GitHub Desktop.
Save larkintuckerllc/3e048ae8b870e0ad260ff07d7971df33 to your computer and use it in GitHub Desktop.
import React from 'react';
import { Entity } from '@backstage/catalog-model';
import { EntityProvider } from '@backstage/plugin-catalog-react';
import { createDevApp } from '@backstage/dev-utils';
import { myPluginPlugin, EntityMyPluginContent } from '../src/plugin';
const mockEntity: Entity = {
apiVersion: 'backstage.io/v1alpha1',
kind: 'Component',
metadata: {
name: 'backstage',
description: 'backstage.io',
annotations: {
'backstage.io/kubernetes-id': 'dice-roller',
},
},
spec: {
lifecycle: 'production',
type: 'service',
owner: 'user:guest',
},
};
createDevApp()
.registerPlugin(myPluginPlugin)
.addPage({
path: '/fixture-1',
title: 'Fixture 1',
element: (
<EntityProvider entity={mockEntity}>
<EntityMyPluginContent />
</EntityProvider>
),
})
.render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment