test(photos): pick calibration before Mask (#60)

Failing session/UI tests for M2-3: Continue → pickCalibration (not
first-photo Mask proxy), user pick enters Mask on that Source, draft
remembers calibrationIndex, Resume restores. No production change yet (TDD).
This commit is contained in:
2026-09-15 21:10:14 +00:00
parent ff4bb0f31e
commit 4fa8126471
2 changed files with 226 additions and 4 deletions
+5 -4
View File
@@ -68,15 +68,16 @@ test('continueBatch is a no-op when batch is empty', () => {
s.dispose();
});
test('continueBatch with ≥1 photo advances (M1 bridge: mask on first photo)', async () => {
test('continueBatch with ≥1 photo advances to pickCalibration (not Mask)', async () => {
// #60: Continue must not silently Mask the first photo — user picks calibration next.
const s = createCaptureSession({ draft: store });
await s.addToBatch(tinyJpeg('a'));
await s.addToBatch(tinyJpeg('b'));
s.continueBatch();
const cap = get(s.capture);
assert.equal(cap.k, 'mask');
if (cap.k === 'mask') {
assert.ok(cap.source.blob instanceof Blob);
assert.equal(cap.k, 'pickCalibration');
if (cap.k === 'pickCalibration') {
assert.equal(cap.photos.length, 2);
}
s.dispose();
});