Addressed PR comments

This commit is contained in:
Ivan Shmidt
2020-06-04 17:06:09 +02:00
parent 3cc59f3276
commit 163be0eafe
5 changed files with 11 additions and 18 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ export class CatalogClient implements CatalogApi {
const { location, entities } = await response.json();
if (!location || entities.length === 0)
throw new Error(`'Location wasn't added: ${target}`);
throw new Error(`Location wasn't added: ${target}`);
return {
location,
+3 -4
View File
@@ -25,8 +25,7 @@ export const catalogApiRef = createApiRef<CatalogApi>({
export interface CatalogApi {
getEntities(): Promise<Entity[]>;
getEntityByName(name: string): Promise<Entity>;
addLocation(
type: string,
target: string,
): Promise<{ location: Location; entities: Entity[] }>;
addLocation(type: string, target: string): Promise<AddLocationResponse>;
}
export type AddLocationResponse = { location: Location; entities: Entity[] };
+1 -9
View File
@@ -14,15 +14,7 @@
* limitations under the License.
*/
/*
* Hi!
*
* Note that this is an EXAMPLE Backstage backend. Please check the README.
*
* Happy hacking!
*/
import { createRouteRef } from '@backstage/core';
import { createRouteRef } from '@backstage/core';
const NoIcon = () => null;
@@ -43,7 +43,7 @@ describe('RegisterComponentResultDialog', () => {
it('should render', () => {
const { rendered } = setup();
expect(
rendered.getByText('Component registration result'),
rendered.getByText('Component Registration Result'),
).toBeInTheDocument();
});
});
@@ -73,7 +73,9 @@ it('should show a list of components if success', async () => {
});
expect(
rendered.getByText('Following components have been succefully created:'),
rendered.getByText(
'The following components have been succefully created:',
),
).toBeInTheDocument();
expect(rendered.getByText('Component1')).toBeInTheDocument();
expect(rendered.getByText('Component2')).toBeInTheDocument();
@@ -48,10 +48,10 @@ export const RegisterComponentResultDialog: FC<Props> = ({
entities,
}) => (
<Dialog open onClose={onClose} classes={classes}>
<DialogTitle>Component registration result</DialogTitle>
<DialogTitle>Component Registration Result</DialogTitle>
<DialogContent>
<DialogContentText>
Following components have been succefully created:
The following components have been succefully created:
</DialogContentText>
<List>
{entities.map((entity: any, index: number) => (