Skip to content

Commit 6516edc

Browse files
Fix failing tests
1 parent 534ed83 commit 6516edc

6 files changed

Lines changed: 136 additions & 149 deletions

File tree

backend/annotation/views_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def test_annotator_cannot_remove_others_labeling(
178178
response = api_client.post("/api/label/", data, format="json")
179179
assert response.status_code == status.HTTP_403_FORBIDDEN
180180
assert (
181-
"You can only remove labels you attached yourself" in response.data["error"]
181+
"You can only remove labels you attached yourself" in response.data["detail"]
182182
)
183183

184184
# Verify labeling was NOT removed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ describe("AnnotationInputComponent", () => {
6767
relationship: KnowledgeBaseRelationship.EQUAL
6868
}
6969
],
70+
labels: [],
7071
dataset: Dataset.USER,
7172
extraData: null
7273
};
@@ -110,6 +111,7 @@ describe("AnnotationInputComponent", () => {
110111
hypothesis: "Empty test hypothesis",
111112
entailmentLabel: EntailmentLabel.NEUTRAL,
112113
kbItems: [],
114+
labels: [],
113115
dataset: Dataset.USER,
114116
extraData: null
115117
};
@@ -134,6 +136,7 @@ describe("AnnotationInputComponent", () => {
134136
hypothesis: "Test hypothesis",
135137
entailmentLabel: EntailmentLabel.CONTRADICTION,
136138
kbItems: [],
139+
labels: [],
137140
dataset: Dataset.USER,
138141
extraData: null
139142
};
@@ -156,6 +159,7 @@ describe("AnnotationInputComponent", () => {
156159
hypothesis: "",
157160
entailmentLabel: EntailmentLabel.UNKNOWN,
158161
kbItems: [],
162+
labels: [],
159163
dataset: Dataset.USER,
160164
extraData: null
161165
};
@@ -176,6 +180,7 @@ describe("AnnotationInputComponent", () => {
176180
hypothesis: "",
177181
entailmentLabel: EntailmentLabel.UNKNOWN,
178182
kbItems: [],
183+
labels: [],
179184
dataset: Dataset.USER,
180185
extraData: null
181186
};

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const createMockProblem = (
1717
premises: ["premise"],
1818
hypothesis: "hypothesis",
1919
kbItems: [],
20+
labels: [],
2021
extraData,
2122
});
2223

@@ -33,10 +34,11 @@ describe("ProblemDetailsComponent", () => {
3334
fixture = TestBed.createComponent(ProblemDetailsComponent);
3435
component = fixture.componentInstance;
3536
const componentRef = fixture.componentRef;
36-
componentRef.setInput("problem", {
37-
id: "1",
38-
dataset: Dataset.SICK,
39-
});
37+
componentRef.setInput("problem", createMockProblem(
38+
1,
39+
Dataset.SICK,
40+
EntailmentLabel.ENTAILMENT
41+
));
4042
fixture.detectChanges();
4143
});
4244

0 commit comments

Comments
 (0)