mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-12 23:31:02 +00:00
fix(journey): a folded Duo on its side gets the compact cards in the wide size class too
The folded Duo on its side is over 500px high and so in the wide size class, whose large cards won over the short window's compact ones. Short is now asked first.
This commit is contained in:
@@ -593,7 +593,8 @@ export default function MJourneyDetail({ journeyId, embedded = false }: JourneyD
|
||||
showMood={current.show_mood !== 0}
|
||||
showWeather={current.show_weather !== 0}
|
||||
tone="mobile"
|
||||
size={wide ? 'large' : short ? 'compact' : 'regular'}
|
||||
// Short before wide: a folded Duo on its side is wide (over 500px high) and short.
|
||||
size={short ? 'compact' : wide ? 'large' : 'regular'}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// FE-MOB-JDET-001 to FE-MOB-JDET-048
|
||||
// FE-MOB-JDET-001 to FE-MOB-JDET-049
|
||||
import { describe, it, expect, beforeEach, afterEach, onTestFinished, vi } from 'vitest';
|
||||
import { render, screen, fireEvent, waitFor, act } from '../../../helpers/render';
|
||||
import { setSizeClass } from '../../../helpers/sizeClass';
|
||||
import { render, screen, fireEvent, waitFor, act } from '../../../helpers/render';
|
||||
import MJourneyDetail from '../../../../src/mobile/screens/journey/MJourneyDetail';
|
||||
import { addonsApi, journeyApi, memoriesApi } from '../../../../src/api/client';
|
||||
import { useJourneyStore } from '../../../../src/store/journeyStore';
|
||||
@@ -256,9 +256,12 @@ describe('MJourneyDetail', () => {
|
||||
};
|
||||
window.matchMedia = tall;
|
||||
onTestFinished(() => { window.matchMedia = real; });
|
||||
// At 720 by 540 it is the wide size class too, whose large cards must not win.
|
||||
setSizeClass('wide');
|
||||
setup();
|
||||
expect(document.querySelector('.h-\\[112px\\]')).toBeInTheDocument();
|
||||
expect(document.querySelector('.h-\\[152px\\]')).not.toBeInTheDocument();
|
||||
expect(document.querySelector('.h-\\[196px\\]')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('FE-MOB-JDET-001: shows a spinner while the journey is loading', () => {
|
||||
|
||||
Reference in New Issue
Block a user