@wovvmap/test-kit 0.0.0-stage → 1.2.0
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/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/package.json +31 -3
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared fixtures, contract suites and SDK conformance helpers will live here.
|
|
3
|
+
* Hinglish: Reusable fixtures, shared contract tests aur SDK compatibility helpers yahan rahenge.
|
|
4
|
+
*/
|
|
5
|
+
import type { ViewerTransport, ViewerUICommandName, ViewerCommandArgs, ViewerCommandResult } from '@wovvmap/contracts';
|
|
6
|
+
/** Exercise UI bindings, not just the raw renderer adapter.
|
|
7
|
+
* Hinglish: Dono SDK ke actual store actions par arguments aur results verify karein. */
|
|
8
|
+
export declare function exerciseViewerUIActions(actions: {
|
|
9
|
+
[K in ViewerUICommandName]: (...args: ViewerCommandArgs[K]) => Promise<ViewerCommandResult<K>>;
|
|
10
|
+
}): Promise<{
|
|
11
|
+
modes: boolean[];
|
|
12
|
+
focus: boolean;
|
|
13
|
+
fit: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
/** Reusable substitution checks for direct, WebView and future Angular adapters.
|
|
16
|
+
* Hinglish: Naya adapter isi suite se names, arguments aur results ki parity prove karega. */
|
|
17
|
+
export declare function exerciseViewerTransport(transport: ViewerTransport): Promise<unknown[]>;
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAE3B;yFACyF;AACzF,wBAAsB,uBAAuB,CAAC,OAAO,EAAE;KACpD,CAAC,IAAI,mBAAmB,GAAG,CAAC,GAAG,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;CAC/F;;;;GAmBA;AAED;8FAC8F;AAC9F,wBAAsB,uBAAuB,CAAC,SAAS,EAAE,eAAe,sBA0BvE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** Exercise UI bindings, not just the raw renderer adapter.
|
|
2
|
+
* Hinglish: Dono SDK ke actual store actions par arguments aur results verify karein. */
|
|
3
|
+
export async function exerciseViewerUIActions(actions) {
|
|
4
|
+
await actions.setFloor(0, false);
|
|
5
|
+
const modes = [await actions.setViewMode('2D', false), await actions.setViewMode('3D', 0)];
|
|
6
|
+
await actions.setDynamicDepth(6, 0.02);
|
|
7
|
+
await actions.setDynamicDepth(6, 0.03);
|
|
8
|
+
await actions.setCameraFocusPadding({ bottom: 240, left: 12 });
|
|
9
|
+
const focus = await actions.focusNode('node', 2, 0, 'sky');
|
|
10
|
+
const fit = await actions.fitToBounds(1, 0, 'street');
|
|
11
|
+
await actions.zoomIn();
|
|
12
|
+
await actions.zoomOut();
|
|
13
|
+
await actions.toggleImages(false, { showLogos: true });
|
|
14
|
+
await actions.toggleShapes(false);
|
|
15
|
+
await actions.updateLabelStyles({ textColor: '#111111' });
|
|
16
|
+
await actions.updateTextColors({ default: '#222222' });
|
|
17
|
+
await actions.updateSpriteThemes({ default: '#333333' });
|
|
18
|
+
await actions.updateShapeColors({ node: '#444444' });
|
|
19
|
+
await actions.updateAnchorGradient(['#555555', '#666666']);
|
|
20
|
+
await actions.updateEdgeColor('#777777');
|
|
21
|
+
return { modes, focus, fit };
|
|
22
|
+
}
|
|
23
|
+
/** Reusable substitution checks for direct, WebView and future Angular adapters.
|
|
24
|
+
* Hinglish: Naya adapter isi suite se names, arguments aur results ki parity prove karega. */
|
|
25
|
+
export async function exerciseViewerTransport(transport) {
|
|
26
|
+
const trace = [];
|
|
27
|
+
const unsubs = [
|
|
28
|
+
transport.on('floorChange', (value) => trace.push(['floorChange', value])),
|
|
29
|
+
transport.on('viewModeChange', (value) => trace.push(['viewModeChange', value])),
|
|
30
|
+
transport.on('nodeSelected', (value) => trace.push(['nodeSelected', value])),
|
|
31
|
+
];
|
|
32
|
+
try {
|
|
33
|
+
const floorResult = await transport.execute('setFloor', [1, false]);
|
|
34
|
+
const modeResult = await transport.execute('setViewMode', ['2D', false]);
|
|
35
|
+
await transport.execute('selectNode', [null]);
|
|
36
|
+
const focusResult = await transport.execute('focusNode', ['missing-node', 2, 0]);
|
|
37
|
+
if (floorResult !== undefined || modeResult !== true || focusResult !== false)
|
|
38
|
+
throw new Error('Adapter changed operation results');
|
|
39
|
+
await transport.execute('destroy', []);
|
|
40
|
+
let rejected = false;
|
|
41
|
+
try {
|
|
42
|
+
await transport.execute('setFloor', [2]);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
rejected = true;
|
|
46
|
+
}
|
|
47
|
+
if (!rejected)
|
|
48
|
+
throw new Error('Destroyed viewer accepted a command');
|
|
49
|
+
return trace;
|
|
50
|
+
}
|
|
51
|
+
finally {
|
|
52
|
+
for (const unsub of unsubs)
|
|
53
|
+
unsub();
|
|
54
|
+
}
|
|
55
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wovvmap/test-kit",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Fixtures, contract suites, and SDK conformance helpers for WovVMap consumers.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@wovvmap/contracts": "1.2.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc -p tsconfig.build.json",
|
|
30
|
+
"lint": "eslint src",
|
|
31
|
+
"test": "vitest run --passWithNoTests",
|
|
32
|
+
"typecheck": "tsc -p tsconfig.build.json --noEmit"
|
|
33
|
+
}
|
|
6
34
|
}
|
package/README.md
DELETED