mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Stories: Back into a deleted story's entry clears ?story= from the address
This commit is contained in:
1 parent
7a0b649bf5
commit
85c9f95838
2 files changed
+30
-7
No files matched your search
@@ -948,6 +948,24 @@ test('Close after Back to Explore still puts AUTHORING’s selection back', asyn
|
||||
controller.destroy();
|
||||
});
|
||||
|
||||
test('Back into the entry of a deleted story, with Stories closed, clears ?story=', () => {
|
||||
const { controller, store } = setup();
|
||||
assert.equal(store.mode, 'closed');
|
||||
history.replaceState(
|
||||
{ gevStories: { story: 'gev:gone', depth: 2, explore: 1 } },
|
||||
'',
|
||||
'/?story=gev%3Agone&storyTime=12#lat=1',
|
||||
);
|
||||
dispatchEvent(new PopStateEvent('popstate'));
|
||||
assert.equal(store.mode, 'closed', 'nothing opens');
|
||||
const url = new URL(location.href);
|
||||
assert.equal(url.searchParams.has('story'), false);
|
||||
assert.equal(url.searchParams.has('storyTime'), false);
|
||||
assert.equal(url.hash, '#lat=1', 'the globe state stays');
|
||||
assert.equal(history.state?.gevStories, undefined);
|
||||
controller.destroy();
|
||||
});
|
||||
|
||||
test('unsaved scenes appear as local drafts and disappear when deleted', () => {
|
||||
setActivePinia(createPinia());
|
||||
history.replaceState(null, '', '/');
|
||||
|
||||
Reference in new issue
Block a user