Skip to content

Commit 395824f

Browse files
Fix frontend tests
1 parent 9df972a commit 395824f

3 files changed

Lines changed: 41 additions & 51 deletions

File tree

frontend/src/app/annotate/annotation-input/annotation-input.component.spec.ts

Lines changed: 37 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -53,37 +53,35 @@ describe("AnnotationInputComponent", () => {
5353
premises: ["First premise", "Second premise"],
5454
hypothesis: "Test hypothesis",
5555
entailmentLabel: EntailmentLabel.ENTAILMENT,
56-
annotations: {
57-
kbAnnotations: [
58-
{
59-
id: 456,
60-
entity1: "cat",
61-
entity2: "animal",
62-
relationship: KnowledgeBaseRelationship.SUBSET,
63-
createdAt: "",
64-
createdBy: "",
65-
removedAt: null,
66-
removedBy: null,
67-
notes: "",
68-
session: null,
69-
removable: true
70-
},
71-
{
72-
id: 789,
73-
entity1: "dog",
74-
entity2: "pet",
75-
relationship: KnowledgeBaseRelationship.EQUAL,
76-
createdAt: "",
77-
createdBy: "",
78-
removedAt: null,
79-
removedBy: null,
80-
notes: "",
81-
session: null,
82-
removable: true
83-
}
84-
],
85-
labelAnnotations: []
86-
},
56+
kbAnnotations: [
57+
{
58+
id: 456,
59+
entity1: "cat",
60+
entity2: "animal",
61+
relationship: KnowledgeBaseRelationship.SUBSET,
62+
createdAt: "",
63+
createdBy: "",
64+
removedAt: null,
65+
removedBy: null,
66+
notes: "",
67+
session: null,
68+
removable: true
69+
},
70+
{
71+
id: 789,
72+
entity1: "dog",
73+
entity2: "pet",
74+
relationship: KnowledgeBaseRelationship.EQUAL,
75+
createdAt: "",
76+
createdBy: "",
77+
removedAt: null,
78+
removedBy: null,
79+
notes: "",
80+
session: null,
81+
removable: true
82+
}
83+
],
84+
labelAnnotations: [],
8785
dataset: Dataset.USER,
8886
extraData: null
8987
};
@@ -126,10 +124,8 @@ describe("AnnotationInputComponent", () => {
126124
premises: [],
127125
hypothesis: "Empty test hypothesis",
128126
entailmentLabel: EntailmentLabel.NEUTRAL,
129-
annotations: {
130-
kbAnnotations: [],
131-
labelAnnotations: []
132-
},
127+
kbAnnotations: [],
128+
labelAnnotations: [],
133129
dataset: Dataset.USER,
134130
extraData: null
135131
};
@@ -152,11 +148,8 @@ describe("AnnotationInputComponent", () => {
152148
entailmentLabel: EntailmentLabel.CONTRADICTION,
153149
dataset: Dataset.USER,
154150
extraData: null,
155-
annotations: {
156-
kbAnnotations: [],
157-
labelAnnotations: [],
158-
159-
},
151+
kbAnnotations: [],
152+
labelAnnotations: [],
160153
};
161154

162155
const form = component['buildForm'](mockProblem);
@@ -178,11 +171,8 @@ describe("AnnotationInputComponent", () => {
178171
entailmentLabel: EntailmentLabel.UNKNOWN,
179172
dataset: Dataset.USER,
180173
extraData: null,
181-
annotations: {
182-
kbAnnotations: [],
183-
labelAnnotations: [],
184-
185-
}
174+
kbAnnotations: [],
175+
labelAnnotations: [],
186176
};
187177

188178
component['navigateToNewProblem'](mockProblem);
@@ -202,10 +192,8 @@ describe("AnnotationInputComponent", () => {
202192
entailmentLabel: EntailmentLabel.UNKNOWN,
203193
dataset: Dataset.USER,
204194
extraData: null,
205-
annotations: {
206-
kbAnnotations: [],
207-
labelAnnotations: [],
208-
}
195+
kbAnnotations: [],
196+
labelAnnotations: [],
209197
};
210198

211199
component['navigateToNewProblem'](mockProblem);

frontend/src/app/annotate/annotation-input/problem-details/problem-details.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const createMockProblem = (
1717
premises: ["premise"],
1818
hypothesis: "hypothesis",
1919
extraData,
20-
annotations: null,
20+
kbAnnotations: [],
21+
labelAnnotations: [],
2122
});
2223

2324
describe("ProblemDetailsComponent", () => {

frontend/src/app/services/problem.service.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ describe("ProblemService", () => {
5858
pairId: 1,
5959
relatednessScore: 4.5
6060
},
61-
annotations: null,
61+
kbAnnotations: [],
62+
labelAnnotations: [],
6263
},
6364
index: 1,
6465
total: 1,

0 commit comments

Comments
 (0)