test(editor): remote source, export sync, saved copies and hero frame

The remote source loads, saves with the settings version, merges a 409, posts one server
job per preset and follows the server's job events; Export "Sync" gating and the send it
queues; "Save both" copies listed and restored through undo; Set hero reaches the index.
A smoke test opens the sample server's proxied sequence in the real window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-03 11:44:43 +00:00
1 parent 2ff3a6503b
commit 36486cb31b
8 files changed
+681 -1

No files matched your search

@@ -101,6 +101,42 @@ public sealed class ProjectStoreTests(TestContext context)
}
}
[Test]
public async Task SetHeroReachesTheLibraryThumbnail()
{
var (db, sequenceId, root) = await ArchiveAsync(6);
await using (db)
{
await using var source = new LocalSequenceSource(db, sequenceId, DecoderFactory.CreateClient(null), null,
new ArchiveServiceOptions { Owner = "test", LeaseWait = TimeSpan.FromSeconds(20) });
var changed = new List<Sequence>();
source.HeroChanged += changed.Add;
var content = await source.LoadAsync(context.Cancellation);
var session = new EditorSession(source, content, [], TimeSpan.FromMilliseconds(20));
await using (session)
{
Assert.True(session.SetHero(4));
Assert.True(await session.FlushAsync());
Assert.Equal(content.Frames[4].Id, (await db.Sequences.GetAsync(sequenceId))!.HeroFrameId, "the index names the hero frame");
Assert.Equal(content.Frames[4].Id, Assert.Contains(changed, _ => true).HeroFrameId, "the Library is told");
session.Edit(p => p with { Exposure = p.Exposure with { ExposureOffsetEv = 0.2 } });
Assert.True(await session.FlushAsync());
Assert.Count(1, changed);
Assert.True(session.Undo());
Assert.True(session.Undo());
Assert.True(await session.FlushAsync());
Assert.Null((await db.Sequences.GetAsync(sequenceId))!.HeroFrameId, "undoing Set hero brings back the first frame");
Assert.Count(2, changed);
}
// "Save both" copies kept by a sync conflict are listed with the sequence.
File.WriteAllText(Path.Combine(root, "Synthetic", ".titano", "project.this-pc-20261003-142200.json"), new ProjectSettings().ToJson());
Assert.Equal(new DateTime(2026, 10, 3, 14, 22, 0), Assert.Contains((await source.LoadAsync(context.Cancellation)).SavedCopies, _ => true).SavedAt);
}
}
[Test]
public async Task ASaveThatDoesNotReachTheIndexThrows()
{