@konfuzio/document-validation-ui 0.1.16-dev.2 → 0.1.16-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konfuzio/document-validation-ui",
3
- "version": "0.1.16-dev.2",
3
+ "version": "0.1.16-dev.3",
4
4
  "repository": "git://github.com:konfuzio-ai/document-validation-ui.git",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -304,4 +304,120 @@ describe("Document Annotations", () => {
304
304
  .find(".empty-annotation")
305
305
  .should("not.have.class", "missing-annotation");
306
306
  });
307
+
308
+ it("gets successfull response from the API when accepting annotation", () => {
309
+ cy.mount(DocumentAnnotations);
310
+
311
+ cy.get("#labels-sidebar")
312
+ .find(".label")
313
+ .find(".annotation-row")
314
+ .find(".not-revised")
315
+ .first()
316
+ .then(($element) => {
317
+ const annotationId = $element[0].id;
318
+
319
+ cy.intercept('PATCH', `**/annotations/${annotationId}/`).as('updateAnnotation');
320
+
321
+ cy.wrap($element)
322
+ .trigger("mouseover");
323
+
324
+ cy.wait(1000);
325
+
326
+ cy.get("#labels-sidebar")
327
+ .find(".label")
328
+ .find(".annotation-row")
329
+ .find(".action-buttons")
330
+ .find(".annotation-accept-btn")
331
+ .click();
332
+
333
+ cy.wait("@updateAnnotation").its("response.statusCode").should("eq", 200);
334
+ })
335
+ });
336
+
337
+ it("gets successfull response from the API when declining annotation", () => {
338
+ cy.mount(DocumentAnnotations);
339
+
340
+ cy.get("#labels-sidebar")
341
+ .find(".label")
342
+ .find(".annotation-row")
343
+ .find(".annotation")
344
+ .first()
345
+ .then(($element) => {
346
+ const annotationId = $element[0].id;
347
+
348
+ cy.intercept('DELETE', `**/annotations/${annotationId}/`).as('deleteAnnotation');
349
+
350
+ cy.wrap($element)
351
+ .trigger("mouseover");
352
+
353
+ cy.wait(1000);
354
+
355
+ cy.get("#labels-sidebar")
356
+ .find(".label")
357
+ .find(".annotation-row")
358
+ .find(".action-buttons")
359
+ .find(".decline-btn")
360
+ .click();
361
+
362
+ cy.wait("@deleteAnnotation").its("response.statusCode").should("eq", 204);
363
+ })
364
+ });
365
+
366
+ it("gets successfull response from the API when marking annotation as missing", () => {
367
+ cy.mount(DocumentAnnotations);
368
+
369
+ cy.get("#labels-sidebar")
370
+ .find(".label")
371
+ .find(".annotation-row")
372
+ .find(".empty-annotation")
373
+ .first()
374
+ .then(($element) => {
375
+ cy.intercept('POST', `**/missing-annotations/`).as('addMissingAnnotations');
376
+
377
+ cy.wrap($element)
378
+ .trigger("mouseover");
379
+
380
+ cy.wait(1000);
381
+
382
+ cy.get("#labels-sidebar")
383
+ .find(".label")
384
+ .find(".annotation-row")
385
+ .find(".action-buttons")
386
+ .find(".missing-btn")
387
+ .click();
388
+
389
+ cy.wait("@addMissingAnnotations").its("response.statusCode").should("eq", 201);
390
+ })
391
+ });
392
+
393
+ it("gets successfull response from the API when restoring missing annotation", () => {
394
+ cy.mount(DocumentAnnotations);
395
+
396
+ cy.get("#labels-sidebar")
397
+ .find(".label")
398
+ .find(".annotation-row")
399
+ .find(".empty-annotation")
400
+ .find(".missing-annotation")
401
+ .first()
402
+ .then(($element) => {
403
+
404
+ cy.getStore("document").then($document => {
405
+ cy.intercept('DELETE', `**/missing-annotations/${$document.missingAnnotations[0].id}/`).as('deleteMissingAnnotation');
406
+ })
407
+
408
+ cy.wrap($element)
409
+ .trigger("mouseover");
410
+
411
+ cy.wait(1000);
412
+
413
+ cy.get("#labels-sidebar")
414
+ .find(".label")
415
+ .find(".annotation-row")
416
+ .find(".action-buttons")
417
+ .find(".restore-btn")
418
+ .click();
419
+
420
+ cy.wait("@deleteMissingAnnotation").its("response.statusCode").should("eq", 204);
421
+ })
422
+ });
307
423
  });
@@ -22,6 +22,7 @@ describe("Document Top Bar", () => {
22
22
 
23
23
  it("Shows category dropdown if not edit mode or reviewed", () => {
24
24
  cy.mount(DocumentTopBar);
25
+ cy.dispatchAction("edit", "disableEditMode");
25
26
 
26
27
  cy.get("#document-top-bar-component")
27
28
  .find(".left-bar-components")
@@ -69,6 +70,7 @@ describe("Document Top Bar", () => {
69
70
 
70
71
  it("Shows keyboard icon", () => {
71
72
  cy.mount(DocumentTopBar);
73
+ cy.dispatchAction("edit", "disableEditMode");
72
74
 
73
75
  cy.get("#document-top-bar-component")
74
76
  .find(".right-bar-components")
@@ -78,6 +80,7 @@ describe("Document Top Bar", () => {
78
80
 
79
81
  it("Shows disabled finish review button", () => {
80
82
  cy.mount(DocumentTopBar);
83
+ cy.dispatchAction("edit", "disableEditMode");
81
84
 
82
85
  cy.get("#document-top-bar-component")
83
86
  .find(".right-bar-components")