Persist rover observation configuration and calibrate Insta360 panorama
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import {before,after,test} from 'node:test';
|
||||
import {createServer} from 'vite';
|
||||
let server,sameConfiguration;
|
||||
before(async()=>{server=await createServer({appType:'custom',logLevel:'silent',server:{middlewareMode:true}});({sameConfiguration}=await server.ssrLoadModule('/src/core/fleet/configurationEquality.ts'));});
|
||||
after(async()=>server?.close());
|
||||
test('lost onboard acknowledgement reconciles across JSON key ordering',()=>{
|
||||
const draft={cameras:{x4:{rotations:{left:90,right:270},panoramaYaw:15}},layouts:{version:1,presets:[]}};
|
||||
const board={layouts:{presets:[],version:1},cameras:{x4:{panoramaYaw:15,rotations:{right:270,left:90}}}};
|
||||
assert.equal(sameConfiguration(draft,board),true);
|
||||
board.cameras.x4.rotations.left=180;
|
||||
assert.equal(sameConfiguration(draft,board),false);
|
||||
});
|
||||
test('array order and absent fields remain meaningful configuration changes',()=>{
|
||||
assert.equal(sameConfiguration({order:['left','right']},{order:['right','left']}),false);
|
||||
assert.equal(sameConfiguration({yaw:0},{}),false);
|
||||
assert.equal(sameConfiguration({yaw:0},{yaw:null}),false);
|
||||
assert.equal(sameConfiguration(null,{}),false);
|
||||
});
|
||||
Reference in New Issue
Block a user