Merge pull request #13705 from taras/fix-url-location

[Catalog] Location url was incorrect in tests
This commit is contained in:
Ben Lambert
2022-09-28 11:05:28 +02:00
committed by GitHub
5 changed files with 14 additions and 9 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/catalog-client': patch
---
Renamed argument in `validateEntity` from `location` to `locationRef`
+2 -2
View File
@@ -68,7 +68,7 @@ export interface CatalogApi {
): Promise<void>;
validateEntity(
entity: Entity,
location: string,
locationRef: string,
options?: CatalogRequestOptions,
): Promise<ValidateEntityResponse>;
}
@@ -130,7 +130,7 @@ export class CatalogClient implements CatalogApi {
): Promise<void>;
validateEntity(
entity: Entity,
location: string,
locationRef: string,
options?: CatalogRequestOptions,
): Promise<ValidateEntityResponse>;
}
@@ -322,7 +322,7 @@ describe('CatalogClient', () => {
name: '',
},
},
'http://example.com',
'url:http://example.com',
),
).toMatchObject({
valid: false,
@@ -350,7 +350,7 @@ describe('CatalogClient', () => {
name: 'good',
},
},
'http://example.com',
'url:http://example.com',
),
).toMatchObject({
valid: true,
@@ -373,7 +373,7 @@ describe('CatalogClient', () => {
name: 'good',
},
},
'http://example.com',
'url:http://example.com',
),
).rejects.toThrow(/Request failed with 500 Error/);
});
+2 -2
View File
@@ -359,7 +359,7 @@ export class CatalogClient implements CatalogApi {
*/
async validateEntity(
entity: Entity,
location: string,
locationRef: string,
options?: CatalogRequestOptions,
): Promise<ValidateEntityResponse> {
const response = await this.fetchApi.fetch(
@@ -370,7 +370,7 @@ export class CatalogClient implements CatalogApi {
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
},
method: 'POST',
body: JSON.stringify({ entity, location }),
body: JSON.stringify({ entity, location: locationRef }),
},
);
+2 -2
View File
@@ -405,11 +405,11 @@ export interface CatalogApi {
* Validate entity and its location.
*
* @param entity - Entity to validate
* @param location - URL location of the entity
* @param locationRef - Location ref in format `url:http://example.com/file`
*/
validateEntity(
entity: Entity,
location: string,
locationRef: string,
options?: CatalogRequestOptions,
): Promise<ValidateEntityResponse>;
}