@3cr/viewer-browser 0.0.62 → 0.0.92
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/components.d.ts +0 -2
- package/coverage/3cr-viewer-browser/index.html +116 -0
- package/coverage/3cr-viewer-browser/index.ts.html +199 -0
- package/coverage/3cr-viewer-browser/src/App.vue.html +316 -0
- package/coverage/3cr-viewer-browser/src/components/WebGL3DR.vue.html +442 -0
- package/coverage/3cr-viewer-browser/src/components/icons/index.html +116 -0
- package/coverage/3cr-viewer-browser/src/components/icons/liver.vue.html +148 -0
- package/coverage/3cr-viewer-browser/src/components/index.html +116 -0
- package/coverage/3cr-viewer-browser/src/components/loading/LoadingSpinner.vue.html +622 -0
- package/coverage/3cr-viewer-browser/src/components/loading/index.html +116 -0
- package/coverage/3cr-viewer-browser/src/components/modal/MftpWebGL3DRModal.vue.html +3118 -0
- package/coverage/3cr-viewer-browser/src/components/modal/index.html +116 -0
- package/coverage/3cr-viewer-browser/src/components/selectors/ValueSelector.vue.html +358 -0
- package/coverage/3cr-viewer-browser/src/components/selectors/index.html +116 -0
- package/coverage/3cr-viewer-browser/src/components/sliders/DoubleSliderSelector.vue.html +487 -0
- package/coverage/3cr-viewer-browser/src/components/sliders/VerticalSliderSelector.vue.html +358 -0
- package/coverage/3cr-viewer-browser/src/components/sliders/index.html +131 -0
- package/coverage/3cr-viewer-browser/src/dataLayer/iconData.ts.html +118 -0
- package/coverage/3cr-viewer-browser/src/dataLayer/index.html +146 -0
- package/coverage/3cr-viewer-browser/src/dataLayer/payloadHandler.ts.html +463 -0
- package/coverage/3cr-viewer-browser/src/dataLayer/scanState.ts.html +598 -0
- package/coverage/3cr-viewer-browser/src/helpers/index.html +146 -0
- package/coverage/3cr-viewer-browser/src/helpers/layoutOverlayStyle.ts.html +406 -0
- package/coverage/3cr-viewer-browser/src/helpers/modelHelper.ts.html +412 -0
- package/coverage/3cr-viewer-browser/src/helpers/utils.ts.html +133 -0
- package/coverage/3cr-viewer-browser/src/index.html +131 -0
- package/coverage/3cr-viewer-browser/src/main.ts.html +124 -0
- package/coverage/3cr-viewer-browser/src/models/LoadViewerOptions.ts.html +166 -0
- package/coverage/3cr-viewer-browser/src/models/index.html +116 -0
- package/coverage/3cr-viewer-browser/src/notifications/index.html +116 -0
- package/coverage/3cr-viewer-browser/src/notifications/notification.ts.html +238 -0
- package/coverage/3cr-viewer-browser/src/plugins/index.html +131 -0
- package/coverage/3cr-viewer-browser/src/plugins/index.ts.html +136 -0
- package/coverage/3cr-viewer-browser/src/plugins/vuetify.ts.html +220 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +296 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/dist/Viewer3CR.js +12 -12
- package/dist/Viewer3CR.mjs +10142 -10179
- package/dist/Viewer3CR.umd.js +12 -12
- package/index.ts +7 -42
- package/package.json +1 -1
- package/src/App.vue +6 -2
- package/src/components/modal/MftpWebGL3DRModal.vue +149 -552
- package/src/components/modal/__tests__/mftp-webgl-3dr-modal.spec.ts +146 -199
- package/src/components/selectors/ValueSelector.vue +4 -0
- package/src/components/selectors/__tests__/value-selector.spec.ts +18 -0
- package/src/components/sliders/DoubleSliderSelector.vue +10 -4
- package/src/components/sliders/__tests__/double-slider-selector.spec.ts +32 -0
- package/src/dataLayer/__tests__/payload-handler.spec.ts +214 -0
- package/src/dataLayer/iconData.ts +11 -0
- package/src/dataLayer/payloadHandler.ts +126 -0
- package/src/dataLayer/scanState.ts +171 -0
- package/src/demo/options.ts +93 -0
- package/src/models/Callbacks.ts +2 -0
- package/src/models/LoadViewerOptions.ts +27 -0
- package/src/models/LoadViewerPayload.ts +8 -0
- package/src/models/__tests__/load-viewer-options.spec.ts +22 -0
- package/src/notifications/__tests__/notification.spec.ts +120 -0
- package/src/notifications/notification.ts +51 -0
- package/vitest.config.mts +1 -0
- package/coverage/.tmp/coverage-100.json +0 -1
- package/coverage/.tmp/coverage-101.json +0 -1
- package/coverage/.tmp/coverage-102.json +0 -1
- package/coverage/.tmp/coverage-103.json +0 -1
- package/coverage/.tmp/coverage-104.json +0 -1
- package/coverage/.tmp/coverage-105.json +0 -1
- package/coverage/.tmp/coverage-106.json +0 -1
- package/coverage/.tmp/coverage-107.json +0 -1
- package/coverage/.tmp/coverage-108.json +0 -1
- package/coverage/.tmp/coverage-109.json +0 -1
- package/coverage/.tmp/coverage-110.json +0 -1
- package/coverage/.tmp/coverage-98.json +0 -1
- package/coverage/.tmp/coverage-99.json +0 -1
- /package/src/{components/modal → demo}/DemoModal.vue +0 -0
- /package/src/{components/modal → demo}/DemoPatientModal.vue +0 -0
|
@@ -12,14 +12,26 @@ import {
|
|
|
12
12
|
InteractivityActions,
|
|
13
13
|
NotificationPayload,
|
|
14
14
|
PositionData,
|
|
15
|
-
PresetsActions,
|
|
16
15
|
ScanMovementActions,
|
|
17
|
-
ScanOrientationActions,
|
|
18
16
|
ScanStateActions,
|
|
19
17
|
ScanView,
|
|
20
18
|
SlidersActions,
|
|
21
19
|
} from "@3cr/types-ts";
|
|
22
20
|
import { flushPromises } from "@vue/test-utils";
|
|
21
|
+
import { PayloadHandler } from "@/dataLayer/payloadHandler";
|
|
22
|
+
import { spyOn } from "@vitest/spy";
|
|
23
|
+
import {
|
|
24
|
+
cSlider,
|
|
25
|
+
currentGreyscalePreset,
|
|
26
|
+
isLayout1x3,
|
|
27
|
+
isLayout2x2,
|
|
28
|
+
setScanState,
|
|
29
|
+
sSlider,
|
|
30
|
+
transactionStarted,
|
|
31
|
+
tSlider,
|
|
32
|
+
} from "@/dataLayer/scanState";
|
|
33
|
+
import { unref } from "vue";
|
|
34
|
+
import { isDemo } from "@/demo/options";
|
|
23
35
|
|
|
24
36
|
vi.mock("@3cr/sdk-browser", async (importOriginal) => {
|
|
25
37
|
const mod = (await importOriginal()) as object;
|
|
@@ -35,12 +47,14 @@ vi.mock("@kyvg/vue3-notification", async (importOriginal) => {
|
|
|
35
47
|
const mod = (await importOriginal()) as object;
|
|
36
48
|
return {
|
|
37
49
|
...mod,
|
|
38
|
-
useNotification: {
|
|
50
|
+
useNotification: vi.fn().mockReturnValue({
|
|
39
51
|
notify: vi.fn(),
|
|
40
|
-
},
|
|
52
|
+
}),
|
|
41
53
|
};
|
|
42
54
|
});
|
|
43
|
-
|
|
55
|
+
let spy = spyOn(PayloadHandler.prototype, "sendPayload").mockImplementation(
|
|
56
|
+
(interfaceType: string, actionType: string, message: any) => Promise.resolve()
|
|
57
|
+
);
|
|
44
58
|
describe("MftpWebGL3DRModal.vue", () => {
|
|
45
59
|
let wrapper = shallowMountVuetify(
|
|
46
60
|
MftpWebGL3DRModal,
|
|
@@ -49,6 +63,12 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
49
63
|
);
|
|
50
64
|
|
|
51
65
|
beforeEach(() => {
|
|
66
|
+
transactionStarted.value = false;
|
|
67
|
+
spy = spyOn(PayloadHandler.prototype, "sendPayload").mockImplementation(
|
|
68
|
+
(interfaceType: string, actionType: string, message: any) =>
|
|
69
|
+
Promise.resolve()
|
|
70
|
+
);
|
|
71
|
+
|
|
52
72
|
wrapper = shallowMountVuetify(
|
|
53
73
|
MftpWebGL3DRModal,
|
|
54
74
|
{}
|
|
@@ -60,6 +80,7 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
60
80
|
|
|
61
81
|
afterEach(() => {
|
|
62
82
|
vi.useRealTimers();
|
|
83
|
+
isDemo.value = false;
|
|
63
84
|
});
|
|
64
85
|
|
|
65
86
|
it("inflates", () => {
|
|
@@ -67,106 +88,85 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
67
88
|
});
|
|
68
89
|
describe("watchers", () => {
|
|
69
90
|
it("scanState.value.Display.Brightness", async () => {
|
|
70
|
-
await testWatcherForDisplay(
|
|
91
|
+
await testWatcherForDisplay("Brightness", SlidersActions.sl01);
|
|
71
92
|
});
|
|
72
93
|
|
|
73
94
|
it("scanState.value.Display.Contrast", async () => {
|
|
74
|
-
await testWatcherForDisplay(
|
|
95
|
+
await testWatcherForDisplay("Contrast", SlidersActions.sl02);
|
|
75
96
|
});
|
|
76
97
|
|
|
77
98
|
it("scanState.value.Display.Opacity", async () => {
|
|
78
|
-
await testWatcherForDisplay(
|
|
99
|
+
await testWatcherForDisplay("Opacity", SlidersActions.sl03);
|
|
79
100
|
});
|
|
80
101
|
|
|
81
102
|
it("scanState.value.Display.WindowLower", async () => {
|
|
82
|
-
await testWatcherForDisplay(
|
|
103
|
+
await testWatcherForDisplay("WindowLower", SlidersActions.sl04);
|
|
83
104
|
});
|
|
84
105
|
|
|
85
106
|
it("scanState.value.Display.WindowUpper", async () => {
|
|
86
|
-
await testWatcherForDisplay(
|
|
107
|
+
await testWatcherForDisplay("WindowUpper", SlidersActions.sl05);
|
|
87
108
|
});
|
|
88
109
|
|
|
89
110
|
it("scanState.value.Display.ThresholdLower", async () => {
|
|
90
|
-
await testWatcherForDisplay(
|
|
91
|
-
wrapper,
|
|
92
|
-
"ThresholdLower",
|
|
93
|
-
SlidersActions.sl06
|
|
94
|
-
);
|
|
111
|
+
await testWatcherForDisplay("ThresholdLower", SlidersActions.sl06);
|
|
95
112
|
});
|
|
96
113
|
|
|
97
114
|
it("scanState.value.Display.ThresholdUpper", async () => {
|
|
98
|
-
await testWatcherForDisplay(
|
|
99
|
-
wrapper,
|
|
100
|
-
"ThresholdUpper",
|
|
101
|
-
SlidersActions.sl07
|
|
102
|
-
);
|
|
115
|
+
await testWatcherForDisplay("ThresholdUpper", SlidersActions.sl07);
|
|
103
116
|
});
|
|
104
117
|
|
|
105
118
|
it("scanState.value.Slice.TransverseLower", async () => {
|
|
106
|
-
await testWatcherForSlice(
|
|
107
|
-
wrapper,
|
|
108
|
-
"TransverseLower",
|
|
109
|
-
SlidersActions.sl08
|
|
110
|
-
);
|
|
119
|
+
await testWatcherForSlice("TransverseLower", SlidersActions.sl08);
|
|
111
120
|
});
|
|
112
121
|
|
|
113
122
|
it("scanState.value.Orientations.Transverse.Slice", async () => {
|
|
114
|
-
await testWatcherForOrientation(
|
|
115
|
-
wrapper,
|
|
116
|
-
"Transverse",
|
|
117
|
-
SlidersActions.sl09
|
|
118
|
-
);
|
|
123
|
+
await testWatcherForOrientation("Transverse", SlidersActions.sl09);
|
|
119
124
|
});
|
|
120
125
|
|
|
121
126
|
it("scanState.value.Slice.TransverseUpper", async () => {
|
|
122
|
-
await testWatcherForSlice(
|
|
123
|
-
wrapper,
|
|
124
|
-
"TransverseUpper",
|
|
125
|
-
SlidersActions.sl10
|
|
126
|
-
);
|
|
127
|
+
await testWatcherForSlice("TransverseUpper", SlidersActions.sl10);
|
|
127
128
|
});
|
|
128
129
|
|
|
129
130
|
it("scanState.value.Slice.SagittalLower", async () => {
|
|
130
|
-
await testWatcherForSlice(
|
|
131
|
+
await testWatcherForSlice("SagittalLower", SlidersActions.sl11);
|
|
131
132
|
});
|
|
132
133
|
|
|
133
134
|
it("scanState.value.Orientations.Sagittal.Slice", async () => {
|
|
134
|
-
await testWatcherForOrientation(
|
|
135
|
+
await testWatcherForOrientation("Sagittal", SlidersActions.sl12);
|
|
135
136
|
});
|
|
136
137
|
|
|
137
138
|
it("scanState.value.Slice.SagittalUpper", async () => {
|
|
138
|
-
await testWatcherForSlice(
|
|
139
|
+
await testWatcherForSlice("SagittalUpper", SlidersActions.sl13);
|
|
139
140
|
});
|
|
140
141
|
|
|
141
142
|
it("scanState.value.Slice.CoronalLower", async () => {
|
|
142
|
-
await testWatcherForSlice(
|
|
143
|
+
await testWatcherForSlice("CoronalLower", SlidersActions.sl14);
|
|
143
144
|
});
|
|
144
145
|
|
|
145
146
|
it("scanState.value.Orientations.Coronal.Slice", async () => {
|
|
146
|
-
await testWatcherForOrientation(
|
|
147
|
+
await testWatcherForOrientation("Coronal", SlidersActions.sl15);
|
|
147
148
|
});
|
|
148
149
|
|
|
149
150
|
it("scanState.value.Slice.CoronalUpper", async () => {
|
|
150
|
-
await testWatcherForSlice(
|
|
151
|
+
await testWatcherForSlice("CoronalUpper", SlidersActions.sl16);
|
|
151
152
|
});
|
|
152
153
|
|
|
153
154
|
it("scanState.value.Slice.CoronalUpper transaction disabled", async () => {
|
|
154
|
-
|
|
155
|
-
await testWatcherForSlice(
|
|
155
|
+
transactionStarted.value = true;
|
|
156
|
+
await testWatcherForSlice("CoronalUpper", SlidersActions.sl16, true);
|
|
156
157
|
});
|
|
157
158
|
|
|
158
159
|
it("scanState.value.InteractionSettings.PanSensivitity transaction disabled", async () => {
|
|
159
|
-
|
|
160
|
+
transactionStarted.value = true;
|
|
160
161
|
await testWatcherForInteractionSettings(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
"PanSensivitity1",
|
|
163
|
+
ScanMovementActions.sm05,
|
|
164
|
+
true
|
|
164
165
|
);
|
|
165
166
|
});
|
|
166
167
|
|
|
167
168
|
it("scanState.value.InteractionSettings.PanSensivitity", async () => {
|
|
168
169
|
await testWatcherForInteractionSettings(
|
|
169
|
-
wrapper,
|
|
170
170
|
"PanSensivitity",
|
|
171
171
|
ScanMovementActions.sm05
|
|
172
172
|
);
|
|
@@ -174,7 +174,6 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
174
174
|
|
|
175
175
|
it("scanState.value.InteractionSettings.ZoomSensitivity", async () => {
|
|
176
176
|
await testWatcherForInteractionSettings(
|
|
177
|
-
wrapper,
|
|
178
177
|
"ZoomSensitivity",
|
|
179
178
|
ScanMovementActions.sm08
|
|
180
179
|
);
|
|
@@ -182,7 +181,6 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
182
181
|
|
|
183
182
|
it("scanState.value.InteractionSettings.RotateSensitivity", async () => {
|
|
184
183
|
await testWatcherForInteractionSettings(
|
|
185
|
-
wrapper,
|
|
186
184
|
"RotateSensitivity",
|
|
187
185
|
ScanMovementActions.sm10
|
|
188
186
|
);
|
|
@@ -190,9 +188,8 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
190
188
|
|
|
191
189
|
it("scanState.value.InteractionSettings.CameraRotateSensitivity", async () => {
|
|
192
190
|
await testWatcherForInteractionSettings(
|
|
193
|
-
wrapper,
|
|
194
191
|
"CameraRotateSensitivity",
|
|
195
|
-
ScanMovementActions.
|
|
192
|
+
ScanMovementActions.sm12
|
|
196
193
|
);
|
|
197
194
|
});
|
|
198
195
|
});
|
|
@@ -249,15 +246,15 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
249
246
|
});
|
|
250
247
|
|
|
251
248
|
it("tSlider should be set", () => {
|
|
252
|
-
expect(
|
|
249
|
+
expect(unref(tSlider)).toStrictEqual([0, 0]);
|
|
253
250
|
});
|
|
254
251
|
|
|
255
252
|
it("sSlider should be set", () => {
|
|
256
|
-
expect(
|
|
253
|
+
expect(unref(sSlider)).toStrictEqual([0, 0]);
|
|
257
254
|
});
|
|
258
255
|
|
|
259
256
|
it("cSlider should be set", () => {
|
|
260
|
-
expect(
|
|
257
|
+
expect(unref(cSlider)).toStrictEqual([0, 0]);
|
|
261
258
|
});
|
|
262
259
|
|
|
263
260
|
it("windowSlider should set", async () => {
|
|
@@ -364,9 +361,10 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
364
361
|
{ Anchor: AnchorPoint.BOTTOM_RIGHT } as PositionData,
|
|
365
362
|
];
|
|
366
363
|
|
|
367
|
-
|
|
364
|
+
setScanState(JSON.stringify(scanState));
|
|
368
365
|
|
|
369
|
-
expect(
|
|
366
|
+
expect(unref(isLayout2x2)).toBeTruthy();
|
|
367
|
+
expect(unref(isLayout1x3)).toBeFalsy();
|
|
370
368
|
});
|
|
371
369
|
|
|
372
370
|
it("should isLayout1x3", async () => {
|
|
@@ -378,15 +376,10 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
378
376
|
{ Anchor: AnchorPoint.BOTTOM_RIGHT } as PositionData,
|
|
379
377
|
];
|
|
380
378
|
|
|
381
|
-
|
|
379
|
+
setScanState(JSON.stringify(scanState));
|
|
382
380
|
|
|
383
|
-
expect(
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
it("should snap", async () => {
|
|
387
|
-
await wrapper.vm.snap();
|
|
388
|
-
|
|
389
|
-
expect(wrapper.emitted()["snap"]).toStrictEqual([[]]);
|
|
381
|
+
expect(unref(isLayout1x3)).toBeTruthy();
|
|
382
|
+
expect(unref(isLayout2x2)).toBeFalsy();
|
|
390
383
|
});
|
|
391
384
|
|
|
392
385
|
it("should getCurrentGreyscalePreset", async () => {
|
|
@@ -407,9 +400,15 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
407
400
|
scanState.Display.WindowLower = 30;
|
|
408
401
|
scanState.Display.WindowUpper = 60;
|
|
409
402
|
|
|
410
|
-
|
|
403
|
+
setScanState(JSON.stringify(scanState));
|
|
411
404
|
await flushPromises();
|
|
412
|
-
expect(
|
|
405
|
+
expect(unref(currentGreyscalePreset)).toBe("testing");
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
it("should isDemo execute option", async () => {
|
|
409
|
+
isDemo.value = true;
|
|
410
|
+
|
|
411
|
+
wrapper.vm.closeModal();
|
|
413
412
|
});
|
|
414
413
|
|
|
415
414
|
it("should getCurrentGreyscalePreset", async () => {
|
|
@@ -432,9 +431,9 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
432
431
|
scanState.Display.WindowLower = 40;
|
|
433
432
|
scanState.Display.WindowUpper = 50;
|
|
434
433
|
|
|
435
|
-
|
|
434
|
+
setScanState(JSON.stringify(scanState));
|
|
436
435
|
await flushPromises();
|
|
437
|
-
expect(
|
|
436
|
+
expect(unref(currentGreyscalePreset)).toBe("testing");
|
|
438
437
|
});
|
|
439
438
|
|
|
440
439
|
it("should getCurrentGreyscalePreset", async () => {
|
|
@@ -457,104 +456,33 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
457
456
|
scanState.Display.WindowLower = 45;
|
|
458
457
|
scanState.Display.WindowUpper = 46;
|
|
459
458
|
|
|
460
|
-
|
|
459
|
+
setScanState(JSON.stringify(scanState));
|
|
461
460
|
await flushPromises();
|
|
462
|
-
expect(
|
|
463
|
-
});
|
|
464
|
-
|
|
465
|
-
it("should rotateByDeg", async () => {
|
|
466
|
-
const view = ScanView.Coronal;
|
|
467
|
-
const deg = 10;
|
|
468
|
-
|
|
469
|
-
vi.spyOn(wrapper.vm, "sendPayload").mockImplementation(
|
|
470
|
-
(it: string, a: string, m: any) => {
|
|
471
|
-
expect(it).toBe(FrontEndInterfaces.scan_orientation);
|
|
472
|
-
expect(a).toBe(ScanOrientationActions.so01);
|
|
473
|
-
expect(m).toStrictEqual({
|
|
474
|
-
Version: "0.0.1",
|
|
475
|
-
View: view,
|
|
476
|
-
Angle: deg,
|
|
477
|
-
});
|
|
478
|
-
return Promise.resolve();
|
|
479
|
-
}
|
|
480
|
-
);
|
|
481
|
-
|
|
482
|
-
await wrapper.vm.rotateByDeg(view, deg);
|
|
461
|
+
expect(unref(currentGreyscalePreset)).toBe(undefined);
|
|
483
462
|
});
|
|
484
463
|
|
|
485
464
|
it("should fullscreenLayout", async () => {
|
|
486
465
|
const view = ScanView.Coronal;
|
|
487
|
-
|
|
488
|
-
vi.spyOn(wrapper.vm, "sendPayload")
|
|
489
|
-
.mockImplementationOnce((it: string, a: string, m: any) => {
|
|
490
|
-
expect(it).toBe(FrontEndInterfaces.layout);
|
|
491
|
-
expect(a).toBe("lo_01");
|
|
492
|
-
expect(m).toStrictEqual({
|
|
493
|
-
Version: "0.0.1",
|
|
494
|
-
});
|
|
495
|
-
return Promise.resolve();
|
|
496
|
-
})
|
|
497
|
-
.mockImplementationOnce((it: string, a: string, m: any) => {
|
|
498
|
-
expect(it).toBe(FrontEndInterfaces.view_selection);
|
|
499
|
-
expect(a).toBe(`vs_0${view + 1}`);
|
|
500
|
-
expect(m).toStrictEqual({
|
|
501
|
-
Version: "0.0.1",
|
|
502
|
-
});
|
|
503
|
-
return Promise.resolve();
|
|
504
|
-
});
|
|
505
|
-
|
|
506
466
|
await wrapper.vm.fullscreenLayout(view);
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
await wrapper.vm.layouts("lo_02");
|
|
522
|
-
});
|
|
523
|
-
|
|
524
|
-
it("should setPreset", async () => {
|
|
525
|
-
const action = PresetsActions.pr01;
|
|
526
|
-
const preset = {};
|
|
527
|
-
|
|
528
|
-
vi.spyOn(wrapper.vm, "sendPayload").mockImplementationOnce(
|
|
529
|
-
(it: string, a: string, m: any) => {
|
|
530
|
-
expect(it).toBe(FrontEndInterfaces.presets);
|
|
531
|
-
expect(a).toBe(action);
|
|
532
|
-
expect(m).toStrictEqual(preset);
|
|
533
|
-
return Promise.resolve();
|
|
534
|
-
}
|
|
535
|
-
);
|
|
536
|
-
|
|
537
|
-
await wrapper.vm.setPreset(action, preset);
|
|
538
|
-
});
|
|
539
|
-
|
|
540
|
-
it("should setPreset pr02", async () => {
|
|
541
|
-
const action = PresetsActions.pr02;
|
|
542
|
-
const preset = {};
|
|
543
|
-
|
|
544
|
-
vi.spyOn(wrapper.vm, "sendPayload").mockImplementationOnce(
|
|
545
|
-
(it: string, a: string, m: any) => {
|
|
546
|
-
expect(it).toBe(FrontEndInterfaces.presets);
|
|
547
|
-
expect(a).toBe(action);
|
|
548
|
-
expect(m).toStrictEqual(preset);
|
|
549
|
-
return Promise.resolve();
|
|
467
|
+
// expect(spy).toHaveBeenNthCalledWith(
|
|
468
|
+
// 1,
|
|
469
|
+
// FrontEndInterfaces.view_selection,
|
|
470
|
+
// `vs_0${view + 1}`,
|
|
471
|
+
// {
|
|
472
|
+
// Version: "1.1.0",
|
|
473
|
+
// }
|
|
474
|
+
// );
|
|
475
|
+
expect(spy).toHaveBeenCalledWith(
|
|
476
|
+
FrontEndInterfaces.view_selection,
|
|
477
|
+
`vs_0${view + 1}`,
|
|
478
|
+
{
|
|
479
|
+
Version: "1.1.0",
|
|
550
480
|
}
|
|
551
481
|
);
|
|
552
|
-
|
|
553
|
-
await wrapper.vm.setPreset(action, preset);
|
|
554
482
|
});
|
|
555
483
|
|
|
556
484
|
it("should getCurrentGreyscalePreset", async () => {
|
|
557
|
-
expect(
|
|
485
|
+
expect(unref(currentGreyscalePreset)).toBe(undefined);
|
|
558
486
|
});
|
|
559
487
|
|
|
560
488
|
it("should getViewName 3D Volume", async () => {
|
|
@@ -610,7 +538,7 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
610
538
|
Version: "1.0.0",
|
|
611
539
|
},
|
|
612
540
|
];
|
|
613
|
-
await
|
|
541
|
+
await setScanState(JSON.stringify(initalState));
|
|
614
542
|
|
|
615
543
|
expect(
|
|
616
544
|
wrapper.vm.getCurrentActiveView({
|
|
@@ -644,83 +572,102 @@ describe("MftpWebGL3DRModal.vue", () => {
|
|
|
644
572
|
});
|
|
645
573
|
|
|
646
574
|
async function testWatcherForDisplay(
|
|
647
|
-
wrapper: any,
|
|
648
575
|
key: string,
|
|
649
|
-
action: SlidersActions
|
|
576
|
+
action: SlidersActions,
|
|
577
|
+
not: boolean = false
|
|
650
578
|
) {
|
|
651
579
|
const scanState = inflateScanState();
|
|
652
580
|
(scanState.Display as any)[key] = 60;
|
|
653
581
|
|
|
654
|
-
|
|
655
|
-
Version: "0.0.1",
|
|
656
|
-
Value: (scanState.Display as any)[key],
|
|
657
|
-
});
|
|
658
|
-
wrapper.vm.setScanState(JSON.stringify(scanState));
|
|
582
|
+
await setScanState(JSON.stringify(scanState));
|
|
659
583
|
|
|
660
584
|
await flushPromises();
|
|
585
|
+
if (not) {
|
|
586
|
+
expect(spy).not.toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
587
|
+
Version: "0.0.1",
|
|
588
|
+
Value: (scanState.Display as any)[key],
|
|
589
|
+
});
|
|
590
|
+
} else {
|
|
591
|
+
expect(spy).toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
592
|
+
Version: "0.0.1",
|
|
593
|
+
Value: (scanState.Display as any)[key],
|
|
594
|
+
});
|
|
595
|
+
}
|
|
661
596
|
}
|
|
662
597
|
|
|
663
598
|
async function testWatcherForSlice(
|
|
664
|
-
wrapper: any,
|
|
665
599
|
key: string,
|
|
666
|
-
action: SlidersActions
|
|
600
|
+
action: SlidersActions,
|
|
601
|
+
not: boolean = false
|
|
667
602
|
) {
|
|
668
603
|
const scanState = inflateScanState();
|
|
669
604
|
(scanState.Slice as any)[key] = 100;
|
|
670
605
|
|
|
671
|
-
|
|
672
|
-
Version: "0.0.1",
|
|
673
|
-
Value: (scanState.Slice as any)[key],
|
|
674
|
-
});
|
|
675
|
-
wrapper.vm.setScanState(JSON.stringify(scanState));
|
|
606
|
+
setScanState(JSON.stringify(scanState));
|
|
676
607
|
|
|
677
608
|
await flushPromises();
|
|
609
|
+
|
|
610
|
+
if (not) {
|
|
611
|
+
expect(spy).not.toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
612
|
+
Version: "0.0.1",
|
|
613
|
+
Value: (scanState.Slice as any)[key],
|
|
614
|
+
});
|
|
615
|
+
} else {
|
|
616
|
+
expect(spy).toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
617
|
+
Version: "0.0.1",
|
|
618
|
+
Value: (scanState.Slice as any)[key],
|
|
619
|
+
});
|
|
620
|
+
}
|
|
678
621
|
}
|
|
679
622
|
|
|
680
623
|
async function testWatcherForOrientation(
|
|
681
|
-
wrapper: any,
|
|
682
624
|
key: string,
|
|
683
|
-
action: SlidersActions
|
|
625
|
+
action: SlidersActions,
|
|
626
|
+
not: boolean = false
|
|
684
627
|
) {
|
|
685
628
|
const scanState = inflateScanState();
|
|
686
629
|
(scanState.Orientations as any)[key].Slice = 100;
|
|
687
630
|
|
|
688
|
-
|
|
689
|
-
Version: "0.0.1",
|
|
690
|
-
Value: (scanState.Orientations as any)[key].Slice,
|
|
691
|
-
});
|
|
692
|
-
wrapper.vm.setScanState(JSON.stringify(scanState));
|
|
631
|
+
setScanState(JSON.stringify(scanState));
|
|
693
632
|
|
|
694
633
|
await flushPromises();
|
|
634
|
+
if (not) {
|
|
635
|
+
expect(spy).not.toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
636
|
+
Version: "0.0.1",
|
|
637
|
+
Value: (scanState.Orientations as any)[key].Slice,
|
|
638
|
+
});
|
|
639
|
+
} else {
|
|
640
|
+
expect(spy).toHaveBeenCalledWith(FrontEndInterfaces.sliders, action, {
|
|
641
|
+
Version: "0.0.1",
|
|
642
|
+
Value: (scanState.Orientations as any)[key].Slice,
|
|
643
|
+
});
|
|
644
|
+
}
|
|
695
645
|
}
|
|
696
646
|
|
|
697
647
|
async function testWatcherForInteractionSettings(
|
|
698
|
-
wrapper: any,
|
|
699
648
|
key: string,
|
|
700
|
-
action: ScanMovementActions
|
|
649
|
+
action: ScanMovementActions,
|
|
650
|
+
not: boolean = false
|
|
701
651
|
) {
|
|
702
652
|
const scanState = inflateScanState();
|
|
703
653
|
(scanState.InteractionSettings as any)[key] = 100;
|
|
704
654
|
|
|
705
|
-
|
|
706
|
-
Version: "0.0.1",
|
|
707
|
-
Value: (scanState.InteractionSettings as any)[key],
|
|
708
|
-
});
|
|
709
|
-
wrapper.vm.setScanState(JSON.stringify(scanState));
|
|
655
|
+
setScanState(JSON.stringify(scanState));
|
|
710
656
|
|
|
711
657
|
await flushPromises();
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
expect(
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
658
|
+
if (not) {
|
|
659
|
+
expect(spy).not.toHaveBeenCalledWith(
|
|
660
|
+
FrontEndInterfaces.scan_movement,
|
|
661
|
+
action,
|
|
662
|
+
{
|
|
663
|
+
Version: "0.0.1",
|
|
664
|
+
Value: (scanState.InteractionSettings as any)[key],
|
|
665
|
+
}
|
|
666
|
+
);
|
|
667
|
+
} else {
|
|
668
|
+
expect(spy).toHaveBeenCalledWith(FrontEndInterfaces.scan_movement, action, {
|
|
669
|
+
Version: "0.0.1",
|
|
670
|
+
Value: (scanState.InteractionSettings as any)[key],
|
|
671
|
+
});
|
|
672
|
+
}
|
|
726
673
|
}
|
|
@@ -7,11 +7,15 @@ import { flushPromises } from "@vue/test-utils";
|
|
|
7
7
|
describe("ValueSelector.vue", () => {
|
|
8
8
|
let wrapper = mountVuetify(ValueSelector, {
|
|
9
9
|
value: 1,
|
|
10
|
+
min: 0,
|
|
11
|
+
max: 100,
|
|
10
12
|
});
|
|
11
13
|
|
|
12
14
|
beforeEach(() => {
|
|
13
15
|
wrapper = mountVuetify(ValueSelector, {
|
|
14
16
|
value: [0, 0],
|
|
17
|
+
min: 0,
|
|
18
|
+
max: 100,
|
|
15
19
|
});
|
|
16
20
|
});
|
|
17
21
|
|
|
@@ -27,6 +31,20 @@ describe("ValueSelector.vue", () => {
|
|
|
27
31
|
expect(wrapper.vm.value).toStrictEqual(1);
|
|
28
32
|
});
|
|
29
33
|
|
|
34
|
+
it("should set text lower than min limits", async () => {
|
|
35
|
+
wrapper.vm.sliderValue = -100;
|
|
36
|
+
await flushPromises();
|
|
37
|
+
|
|
38
|
+
expect(wrapper.emitted()["update:value"]).toStrictEqual([[0]]);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("should set text higher than max limits", async () => {
|
|
42
|
+
wrapper.vm.sliderValue = 9000;
|
|
43
|
+
await flushPromises();
|
|
44
|
+
|
|
45
|
+
expect(wrapper.emitted()["update:value"]).toStrictEqual([[100]]);
|
|
46
|
+
});
|
|
47
|
+
|
|
30
48
|
it("should set text", async () => {
|
|
31
49
|
const slider = wrapper.findAllComponents(".v-text-field");
|
|
32
50
|
|
|
@@ -35,10 +35,12 @@ const sliderValue = computed({
|
|
|
35
35
|
},
|
|
36
36
|
set(value: Array<number>) {
|
|
37
37
|
let val = value;
|
|
38
|
-
if (
|
|
39
|
-
if (
|
|
40
|
-
if (
|
|
41
|
-
if (
|
|
38
|
+
if (val[0] > props.max) val[0] = props.max;
|
|
39
|
+
if (val[1] > props.max) val[1] = props.max;
|
|
40
|
+
if (val[0] < props.min) val[0] = props.min;
|
|
41
|
+
if (val[1] < props.min) val[1] = props.min;
|
|
42
|
+
console.log(val);
|
|
43
|
+
console.log(props);
|
|
42
44
|
const normalised = [Math.floor(val[0]), Math.floor(val[1])];
|
|
43
45
|
emit("update:value", normalised);
|
|
44
46
|
},
|
|
@@ -57,6 +59,10 @@ watch(
|
|
|
57
59
|
},
|
|
58
60
|
{ deep: true }
|
|
59
61
|
);
|
|
62
|
+
|
|
63
|
+
defineExpose({
|
|
64
|
+
sliderValue,
|
|
65
|
+
});
|
|
60
66
|
</script>
|
|
61
67
|
|
|
62
68
|
<template>
|