@@ -141,6 +141,8 @@ function getSectionOrder() {
141141 } ;
142142}
143143
144+ // Locks in the canonical mobile ordering from https://github.com/Expensify/App/issues/85075:
145+ // Getting started must always sit above For you on narrow layouts, regardless of the onboarding intent.
144146describe ( 'HomePage mobile ordering' , ( ) => {
145147 beforeAll ( ( ) => {
146148 Onyx . init ( { keys : ONYXKEYS } ) ;
@@ -152,36 +154,14 @@ describe('HomePage mobile ordering', () => {
152154 await waitForBatchedUpdates ( ) ;
153155 } ) ;
154156
155- it ( 'renders ForYouSection before GettingStartedSection when introSelected.choice is TRACK_WORKSPACE on narrow layout' , async ( ) => {
156- await Onyx . set ( ONYXKEYS . NVP_INTRO_SELECTED , {
157- choice : CONST . ONBOARDING_CHOICES . TRACK_WORKSPACE ,
158- } ) ;
159- await waitForBatchedUpdates ( ) ;
160-
161- renderHomePage ( ) ;
162-
163- const { forYouIndex, gettingStartedIndex} = getSectionOrder ( ) ;
164- expect ( forYouIndex ) . toBeGreaterThanOrEqual ( 0 ) ;
165- expect ( gettingStartedIndex ) . toBeGreaterThanOrEqual ( 0 ) ;
166- expect ( forYouIndex ) . toBeLessThan ( gettingStartedIndex ) ;
167- } ) ;
168-
169- it ( 'renders ForYouSection before GettingStartedSection when introSelected.choice is undefined but onboardingPurpose is TRACK_WORKSPACE on narrow layout' , async ( ) => {
170- await Onyx . set ( ONYXKEYS . ONBOARDING_PURPOSE_SELECTED , CONST . ONBOARDING_CHOICES . TRACK_WORKSPACE as never ) ;
171- await waitForBatchedUpdates ( ) ;
172-
173- renderHomePage ( ) ;
174-
175- const { forYouIndex, gettingStartedIndex} = getSectionOrder ( ) ;
176- expect ( forYouIndex ) . toBeGreaterThanOrEqual ( 0 ) ;
177- expect ( gettingStartedIndex ) . toBeGreaterThanOrEqual ( 0 ) ;
178- expect ( forYouIndex ) . toBeLessThan ( gettingStartedIndex ) ;
179- } ) ;
180-
181- it ( 'keeps GettingStartedSection before ForYouSection when intent is MANAGE_TEAM on narrow layout' , async ( ) => {
182- await Onyx . set ( ONYXKEYS . NVP_INTRO_SELECTED , {
183- choice : CONST . ONBOARDING_CHOICES . MANAGE_TEAM ,
184- } ) ;
157+ it . each ( [
158+ [ 'no onboarding intent set' , undefined ] ,
159+ [ 'MANAGE_TEAM intent' , CONST . ONBOARDING_CHOICES . MANAGE_TEAM ] ,
160+ [ 'TRACK_WORKSPACE intent' , CONST . ONBOARDING_CHOICES . TRACK_WORKSPACE ] ,
161+ ] ) ( 'renders GettingStartedSection before ForYouSection on narrow layout with %s' , async ( _label , choice ) => {
162+ if ( choice ) {
163+ await Onyx . set ( ONYXKEYS . NVP_INTRO_SELECTED , { choice} ) ;
164+ }
185165 await waitForBatchedUpdates ( ) ;
186166
187167 renderHomePage ( ) ;
0 commit comments