Merge pull request #13705 from taras/fix-url-location
[Catalog] Location url was incorrect in tests
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/catalog-client': patch
|
||||
---
|
||||
|
||||
Renamed argument in `validateEntity` from `location` to `locationRef`
|
||||
@@ -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/);
|
||||
});
|
||||
|
||||
@@ -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 }),
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -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>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user