test: lock journey lifecycle and static fallback

This commit is contained in:
2026-09-02 05:36:59 +03:00
parent 130ff2d8bb
commit a86767cdc6
11 changed files with 478 additions and 5 deletions

View File

@@ -200,7 +200,7 @@ describe('useMotionPreferences', () => {
connection.saveData = true;
connection.dispatchEvent(new Event('change'));
await nextTick();
expect(wrapper.vm.policy).toMatchObject({ reason: 'data-saver', allowSceneRequest: false });
expect(wrapper.vm.policy).toMatchObject({ reason: 'saved-static', allowSceneRequest: false });
connection.saveData = false;
connection.dispatchEvent(new Event('change'));
@@ -209,6 +209,10 @@ describe('useMotionPreferences', () => {
coarseQuery.dispatchEvent(new Event('change'));
window.dispatchEvent(new Event('resize'));
await nextTick();
expect(wrapper.vm.policy).toMatchObject({ reason: 'saved-static', maximumTier: 'static' });
wrapper.vm.setMaximumQuality('high');
await nextTick();
expect(wrapper.vm.policy).toMatchObject({ reason: 'full', maximumTier: 'low' });
wrapper.unmount();