Back to Body Journal
SOURCE / PINNED RELEASE

Made of little things.

Body Journal

Release
e8049f8da4e2…
Author-recorded commit
61c04bf0e8aa…
License
LICENSE
Author’s source reference
nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-6c4554844c7

Archive hash verified: 4369d778da046a8b…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

tests/anatomy-corrections-smoke.mjs
import assert from 'node:assert/strict';
import {createRequire} from 'node:module';
import {realpathSync} from 'node:fs';
import {mkdir} from 'node:fs/promises';
import {execFileSync} from 'node:child_process';
const require=createRequire(realpathSync('node_modules/@napplet/conformance-cli/package.json'));
const {chromium}=require('playwright'),info=JSON.parse(execFileSync('soyli',['browser','path','--json'],{encoding:'utf8'}));
const browser=await chromium.launch({executablePath:info.executables.find(e=>e.name==='chromium'&&e.installed).path,headless:true});
const output='.napplet-space/anatomy-corrections';await mkdir(output,{recursive:true});
try{
 const page=await browser.newPage({viewport:{width:1600,height:1100}}),errors=[];page.on('pageerror',e=>errors.push(e.message));await page.goto(process.argv[2]);
 const iframe=page.locator('iframe');await iframe.waitFor();const fit=()=>iframe.evaluate(e=>e.style.cssText='position:fixed;inset:0;width:1600px;height:1100px;z-index:9999;border:0');await fit();
 let f=await(await iframe.elementHandle()).contentFrame();await f.locator('#app[data-ready="true"]').waitFor();
 const shot=async name=>{await f.evaluate(()=>new Promise(r=>requestAnimationFrame(()=>requestAnimationFrame(r))));await page.screenshot({path:`${output}/${name}.png`});};
 for(const sex of ['Male','Female']){
  await f.locator('#sex').selectOption(sex);await f.locator('#anatomyLayer').selectOption('muscles');
  for(const view of ['front','back','left']){await f.locator(`[data-view="${view}"]`).click();await shot(`muscles-${sex}-${view}`);}
  await f.locator('#anatomyLayer').selectOption('skeleton');await f.locator('[data-view="front"]').click();await shot(`skeleton-${sex}`);
  await f.locator('#anatomyLayer').selectOption('organs');await f.locator('#focusPelvis').click();await shot(`pelvis-${sex}-front`);
  await f.locator('[data-view="left"]').click();await f.locator('#focusPelvis').click();await shot(`pelvis-${sex}-side`);
  await f.locator('[data-view="front"]').click();await f.locator('#focusPelvis').click();await f.locator('button[data-mode="paint"]').click();
  const box=await f.locator('canvas').boundingBox();let found=false;
  scan:for(const y of [.43,.48,.53,.58,.63,.68,.73,.78,.83,.38,.33])for(const x of [.5,.52,.48,.54,.46,.56,.44]){
   await page.mouse.move(box.x+box.width*x,box.y+box.height*y);const label=await f.locator('#sceneHint').innerText();
   if(sex==='Male'?/Glans penis|testis/.test(label):/labium|Uterus|ovary/.test(label)){await page.mouse.click(box.x+box.width*x,box.y+box.height*y);found=true;break scan;}
  }
  assert.ok(found,`${sex} reproductive anatomy can be painted`);assert.equal(await f.locator('#concernCount').innerText(),sex==='Male'?'1':'2');assert.match(await f.locator('#location').inputValue(),sex==='Male'?/Glans penis|testis/:/labium|Uterus|ovary/);await f.locator('#description').fill(`Synthetic ${sex} reproductive anatomy check.`);
  await shot(`pelvis-${sex}-painted`);
 }
 await f.locator('#anatomy').selectOption('none');await shot('pelvis-hidden');await f.locator('#anatomy').selectOption('penis');await shot('pelvis-manual-male');
 await f.locator('#anatomy').selectOption('auto');await f.waitForFunction(()=>document.querySelector('#sessionStatus').textContent==='Session saved');await page.reload();await iframe.waitFor();await fit();f=await(await iframe.elementHandle()).contentFrame();await f.locator('#app[data-ready="true"]').waitFor();
 assert.equal(await f.locator('#sex').inputValue(),'Female');assert.equal(await f.locator('#anatomyLayer').inputValue(),'organs');assert.match(await f.locator('#description').inputValue(),/Female/);
 assert.deepEqual(errors,[]);console.log('PASS: muscle front/back/side and skeletal views; male/female reproductive surface painting, override/hide, SDK persistence and reload.');
}finally{await browser.close();}