[ACS-8001] fix import

This commit is contained in:
Mykyta Maliarchuk
2024-06-11 23:01:07 +02:00
committed by Mykyta Maliarchuk
parent 654dec8d57
commit b5877e6faa

View File

@@ -22,7 +22,10 @@ import {
Category, Category,
CategoryPaging, CategoryPaging,
ClassesApi, ClassesApi,
Node, Prediction, PredictionPaging, ReviewStatus, Node,
Prediction,
PredictionPaging,
ReviewStatus,
Tag, Tag,
TagBody, TagBody,
TagEntry, TagEntry,
@@ -1692,7 +1695,7 @@ describe('ContentMetadataComponent', () => {
const getMockPredictionPaging = (predictions: Prediction[]): PredictionPaging => ({ const getMockPredictionPaging = (predictions: Prediction[]): PredictionPaging => ({
list: { list: {
entries: predictions.map(prediction => ({entry: prediction})) entries: predictions.map((prediction) => ({ entry: prediction }))
} }
}); });
@@ -1701,7 +1704,9 @@ describe('ContentMetadataComponent', () => {
beforeEach(() => { beforeEach(() => {
component.node = node; component.node = node;
component.displayPredictions = true; component.displayPredictions = true;
getPredictionsSpy = spyOn(predictionService, 'getPredictions').and.returnValue(of(getMockPredictionPaging([getMockPrediction(ReviewStatus.UNREVIEWED)]))); getPredictionsSpy = spyOn(predictionService, 'getPredictions').and.returnValue(
of(getMockPredictionPaging([getMockPrediction(ReviewStatus.UNREVIEWED)]))
);
fixture.detectChanges(); fixture.detectChanges();
}); });
@@ -1723,7 +1728,7 @@ describe('ContentMetadataComponent', () => {
); );
component.ngOnInit(); component.ngOnInit();
component.basicProperties$.subscribe(properties => { component.basicProperties$.subscribe((properties) => {
expect(properties[0].prediction).toEqual(getMockPrediction(ReviewStatus.UNREVIEWED)); expect(properties[0].prediction).toEqual(getMockPrediction(ReviewStatus.UNREVIEWED));
done(); done();
}); });
@@ -1735,25 +1740,29 @@ describe('ContentMetadataComponent', () => {
{ {
editable: true, editable: true,
title: 'test', title: 'test',
properties: [{ properties: [
{
key: 'properties.test:test', key: 'properties.test:test',
editable: true, editable: true,
value: 'new value', value: 'new value',
title: 'test' title: 'test'
}] }
]
} }
]) ])
); );
component.ngOnInit(); component.ngOnInit();
component.groupedProperties$.subscribe(properties => { component.groupedProperties$.subscribe((properties) => {
expect(properties[0].properties[0].prediction).toEqual(getMockPrediction(ReviewStatus.UNREVIEWED)); expect(properties[0].properties[0].prediction).toEqual(getMockPrediction(ReviewStatus.UNREVIEWED));
done(); done();
}); });
}); });
it('should not map predictions when reviewStatus other then UNREVIEWED', (done) => { it('should not map predictions when reviewStatus other then UNREVIEWED', (done) => {
getPredictionsSpy.and.returnValue(of(getMockPredictionPaging([getMockPrediction(ReviewStatus.REJECTED), getMockPrediction(ReviewStatus.CONFIRMED)]))); getPredictionsSpy.and.returnValue(
of(getMockPredictionPaging([getMockPrediction(ReviewStatus.REJECTED), getMockPrediction(ReviewStatus.CONFIRMED)]))
);
getBasicPropertiesSpy.and.returnValue( getBasicPropertiesSpy.and.returnValue(
of([ of([
{ {
@@ -1766,7 +1775,7 @@ describe('ContentMetadataComponent', () => {
); );
component.ngOnInit(); component.ngOnInit();
component.basicProperties$.subscribe(properties => { component.basicProperties$.subscribe((properties) => {
expect(properties[0].prediction).toBeNull(); expect(properties[0].prediction).toBeNull();
done(); done();
}); });
@@ -1785,7 +1794,7 @@ describe('ContentMetadataComponent', () => {
); );
component.ngOnInit(); component.ngOnInit();
component.basicProperties$.subscribe(properties => { component.basicProperties$.subscribe((properties) => {
expect(properties[0].prediction).toBeNull(); expect(properties[0].prediction).toBeNull();
done(); done();
}); });