DWVv0.37.0

tests/app

Source: dataController.test.js:24


Instance Methods

appLoadDataCreationError()

Tests for App load with a data creation error.

makeDataElement(vr: string, value: Array): DataElement

Create a data element with a given VR and value.

Parameters

  • vr (string) — The value representation.
  • value (Array) — The element value.

Returns

makeSliceData( z: number, uid: string, meta: Record.<string, DataElement>, ): DicomData

Create a single slice DicomData at a given z origin with the given meta tags.

Parameters

  • z (number) — The slice z origin.
  • uid (string) — The slice image uid.
  • meta (Record.<string, DataElement>) — The slice meta data.

Returns

datacontrollerClass()

Tests for DataController.

datacontrollerMultiFrameMultiVolume()

Tests for DataController with multi-frame multi-volume files.

datacontrollerMultiFrameMultiVolumePerFile()

Tests for DataController with multi-frame files that each contain multiple volumes.

dicomSliceDataListBuildData()

Tests for DicomSliceDataList#buildData.

makeAnnotation(uid: string): object

Build a minimal annotation-like stub with a given tracking UID.

Parameters

  • uid (string) — The tracking UID.

Returns

  • object — Annotation stub.

recordEvents(group: AnnotationGroup): Array

Listen to the annotation events of a group.

Parameters

Returns

  • Array — The list of received {type, detail}, filled on the go.

recordEvents(controller: LoadController): Array

Listen to all load events of a controller.

Parameters

Returns

  • Array — The list of received {type, detail}, filled on the go.

lastLoader(): MockLoader

Get the last created mock loader.

Returns

  • MockLoader — The loader.

touchEvent(type: string, nTargetTouches?: number): Event

Create a touch-like event.

Parameters

  • type (string) — The event type.
  • nTargetTouches (number, optional, default: 0) — The number of touches still on the event target.

Returns

  • Event — The event.

makeController(rootDocument?: EventTarget): object

Create a controller with two test tools.

Parameters

  • rootDocument (EventTarget, optional) — Optional root document.

Returns

  • object — The controller and its tools.

recordEvents(controller: UndoController): Array

Listen to all undo events of a controller.

Parameters

Returns

  • Array — The list of received {type, detail}, filled on the go.

Other

TagKeys

Related DICOM tag keys.

TestTool

Test tool that records its calls.

TestLayer

Test layer: an event target with interaction bind counters.

Parameters

  • id (string) — The layer id.

TestElement

Test element: an event target with a tag name.

Parameters

  • tagName (string) — The tag name.

TestLayerGroup

Test layer group: an event target with a div id.

Parameters

  • divId (string) — The div id.

TestCommand

Test command that records its execute/undo calls.

Parameters

  • name (string) — The command name.