|
|
|
@ -147,6 +147,9 @@ describe('SchemasService', () => { |
|
|
|
label: 'label1', |
|
|
|
hints: 'hints1' |
|
|
|
}, |
|
|
|
previewUrls: { |
|
|
|
'Default': 'url' |
|
|
|
}, |
|
|
|
fields: [ |
|
|
|
{ |
|
|
|
fieldId: 11, |
|
|
|
@ -312,6 +315,9 @@ describe('SchemasService', () => { |
|
|
|
new RootFieldDto(19, 'field19', createProperties('String'), 'language', true, true, true), |
|
|
|
new RootFieldDto(20, 'field20', createProperties('Tags'), 'language', true, true, true) |
|
|
|
], |
|
|
|
{ |
|
|
|
'Default': 'url' |
|
|
|
}, |
|
|
|
'<script-query>', |
|
|
|
'<script-create>', |
|
|
|
'<script-update>', |
|
|
|
@ -343,8 +349,7 @@ describe('SchemasService', () => { |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
expect(schema!).toEqual( |
|
|
|
new SchemaDetailsDto('1', dto.name, '', new SchemaPropertiesDto(), true, false, now, user, now, user, new Version('2'), [])); |
|
|
|
expect(schema!).toEqual(new SchemaDetailsDto('1', dto.name, '', new SchemaPropertiesDto(), true, false, now, user, now, user, new Version('2'), [], {})); |
|
|
|
})); |
|
|
|
|
|
|
|
it('should make put request to update schema', |
|
|
|
@ -392,6 +397,21 @@ describe('SchemasService', () => { |
|
|
|
req.flush({}); |
|
|
|
})); |
|
|
|
|
|
|
|
it('should make put request to update preview urls', |
|
|
|
inject([SchemasService, HttpTestingController], (schemasService: SchemasService, httpMock: HttpTestingController) => { |
|
|
|
|
|
|
|
const dto = {}; |
|
|
|
|
|
|
|
schemasService.putPreviewUrls('my-app', 'my-schema', dto, version).subscribe(); |
|
|
|
|
|
|
|
const req = httpMock.expectOne('http://service/p/api/apps/my-app/schemas/my-schema/preview-urls'); |
|
|
|
|
|
|
|
expect(req.request.method).toEqual('PUT'); |
|
|
|
expect(req.request.headers.get('If-Match')).toBe(version.value); |
|
|
|
|
|
|
|
req.flush({}); |
|
|
|
})); |
|
|
|
|
|
|
|
it('should make post request to add field', |
|
|
|
inject([SchemasService, HttpTestingController], (schemasService: SchemasService, httpMock: HttpTestingController) => { |
|
|
|
|
|
|
|
|