Skip to content

Commit 28b7515

Browse files
frcrothfm3
andauthored
Add e2e test for readable annotations (#7636)
* Add e2e test for readable annotations * Lint * Lint again * Make it volatile * Move test in front of db changes * ensure serial test ordering so that side-effects of the other tests don’t interfere with annotation listing --------- Co-authored-by: Florian M <[email protected]>
1 parent a0bf300 commit 28b7515

File tree

13 files changed

+122
-0
lines changed

13 files changed

+122
-0
lines changed

frontend/javascripts/test/backend-snapshot-tests/annotations.e2e.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ test("getAnnotationInformation() for public annotation while logged out", async
5050
});
5151
setCurrToken(tokenUserA);
5252
});
53+
test.serial("getReadableAnnotations()", async (t) => {
54+
const annotations = await api.getReadableAnnotations(false, 0);
55+
t.snapshot(replaceVolatileValues(annotations), {
56+
id: "annotations-listReadable",
57+
});
58+
});
5359
test.serial("finishAnnotation() and reOpenAnnotation() for task", async (t) => {
5460
const annotationId = "78135c192faeb34c0081c05d";
5561
const finishedAnnotation = await api.finishAnnotation(annotationId, APIAnnotationTypeEnum.Task);

frontend/javascripts/test/snapshots/public-test/test-bundle/test/backend-snapshot-tests/annotations.e2e.js.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,122 @@ Generated by [AVA](https://avajs.dev).
244244
visibility: 'Public',
245245
}
246246

247+
## annotations-listReadable
248+
249+
[
250+
{
251+
annotationLayers: [
252+
{
253+
name: 'Skeleton',
254+
stats: {
255+
branchPointCount: 0,
256+
edgeCount: 28965,
257+
nodeCount: 28967,
258+
treeCount: 2,
259+
},
260+
tracingId: 'tracingId',
261+
typ: 'Skeleton',
262+
},
263+
],
264+
dataSetName: '2012-06-28_Cortex',
265+
description: '',
266+
id: 'id',
267+
modified: 'modified',
268+
name: '',
269+
organization: 'Organization_X',
270+
othersMayEdit: true,
271+
owner: {
272+
firstName: 'user_A',
273+
id: 'id',
274+
lastName: 'BoyA',
275+
},
276+
state: 'Active',
277+
stats: {},
278+
tags: [
279+
'2012-06-28_Cortex',
280+
'skeleton',
281+
],
282+
teams: [],
283+
tracingTime: 'tracingTime',
284+
typ: 'Explorational',
285+
visibility: 'Public',
286+
},
287+
{
288+
annotationLayers: [
289+
{
290+
name: 'Skeleton',
291+
stats: {
292+
branchPointCount: 0,
293+
edgeCount: 28965,
294+
nodeCount: 28967,
295+
treeCount: 2,
296+
},
297+
tracingId: 'tracingId',
298+
typ: 'Skeleton',
299+
},
300+
],
301+
dataSetName: '2012-06-28_Cortex',
302+
description: '',
303+
id: 'id',
304+
modified: 'modified',
305+
name: '',
306+
organization: 'Organization_X',
307+
othersMayEdit: false,
308+
owner: {
309+
firstName: 'user_A',
310+
id: 'id',
311+
lastName: 'BoyA',
312+
},
313+
state: 'Active',
314+
stats: {},
315+
tags: [
316+
'2012-06-28_Cortex',
317+
'skeleton',
318+
],
319+
teams: [],
320+
tracingTime: 'tracingTime',
321+
typ: 'Explorational',
322+
visibility: 'Internal',
323+
},
324+
{
325+
annotationLayers: [
326+
{
327+
name: 'Skeleton',
328+
stats: {
329+
branchPointCount: 0,
330+
edgeCount: 28965,
331+
nodeCount: 28967,
332+
treeCount: 2,
333+
},
334+
tracingId: 'tracingId',
335+
typ: 'Skeleton',
336+
},
337+
],
338+
dataSetName: '2012-06-28_Cortex',
339+
description: '',
340+
id: 'id',
341+
modified: 'modified',
342+
name: '',
343+
organization: 'Organization_X',
344+
othersMayEdit: false,
345+
owner: {
346+
firstName: 'user_A',
347+
id: 'id',
348+
lastName: 'BoyA',
349+
},
350+
state: 'Active',
351+
stats: {},
352+
tags: [
353+
'2012-06-28_Cortex',
354+
'skeleton',
355+
],
356+
teams: [],
357+
tracingTime: 'tracingTime',
358+
typ: 'Explorational',
359+
visibility: 'Internal',
360+
},
361+
]
362+
247363
## annotations-finishAnnotation
248364

249365
{

0 commit comments

Comments
 (0)