mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-24 04:02:19 +00:00
A link to only a view opens with the opening too, stopping at that view
The app writes its view into the address, so a reload or a bookmark is a share link and opened without the opening. A start-up share whose camera landed and that follows or selects nothing now plays it as well, ending where the link points; the share restore says when the share is of a thing. The flight turns to the target's heading and pitch over its last part, so a view at an angle is reached without a jump. A camera held in a target's frame plays no opening.
This commit is contained in:
1 parent
9088c01d1a
commit
31ce6cbf79
6 files changed
+120
-25
No files matched your search
@@ -163,18 +163,46 @@ test('a bare address plays the opening, and welcome waits for its end', async ()
|
||||
assert.ok(events.includes('opening:cancel'));
|
||||
});
|
||||
|
||||
test('a shared view opens without the opening', async () => {
|
||||
const VIEW_ONLY = Object.freeze({
|
||||
status: 'settled',
|
||||
share: { camera: 'applied' },
|
||||
tracking: { status: 'skipped', reason: 'no-shared-target' },
|
||||
thing: false,
|
||||
});
|
||||
|
||||
test('a link to only a view opens with the opening, ending at that view', async () => {
|
||||
const events = [];
|
||||
const opening = openingStub(events);
|
||||
const f = fixture({ playOpening: opening.play, hasShareState: true });
|
||||
f.restored();
|
||||
f.restored(VIEW_ONLY);
|
||||
f.fire(1000);
|
||||
await flush();
|
||||
assert.equal(opening.calls.length, 0);
|
||||
assert.deepEqual(f.events, ['hidden']);
|
||||
assert.equal(opening.calls.length, 1);
|
||||
await f.stop();
|
||||
});
|
||||
|
||||
for (const [name, restored] of [
|
||||
['a followed target', { ...VIEW_ONLY, tracking: { status: 'restored' } }],
|
||||
['a shared thing', { ...VIEW_ONLY, thing: true }],
|
||||
[
|
||||
'a camera the person moved first',
|
||||
{ ...VIEW_ONLY, share: { camera: 'superseded' } },
|
||||
],
|
||||
['a failed restore', { status: 'failed' }],
|
||||
]) {
|
||||
test(`a link to ${name} opens without the opening`, async () => {
|
||||
const events = [];
|
||||
const opening = openingStub(events);
|
||||
const f = fixture({ playOpening: opening.play, hasShareState: true });
|
||||
f.restored(restored);
|
||||
f.fire(1000);
|
||||
await flush();
|
||||
assert.equal(opening.calls.length, 0);
|
||||
assert.deepEqual(f.events, ['hidden']);
|
||||
await f.stop();
|
||||
});
|
||||
}
|
||||
|
||||
test('without an opening to play the cover hides as before', async () => {
|
||||
const f = fixture({ playOpening: () => null });
|
||||
f.restored();
|
||||
|
||||
Reference in new issue
Block a user