@@ -158,68 +158,3 @@ describe('reverification interrupted requests', () => {
158158 actor . stop ( ) ;
159159 } ) ;
160160} ) ;
161-
162- describe ( 'reverification preparation overlays' , ( ) => {
163- it ( 'blocks leaving a pending picker and preserves help opened over the factor' , async ( ) => {
164- const effects = deps ( ) ;
165- const pending = deferred < ReverificationPreparation > ( ) ;
166- effects . prepare = vi . fn ( ( ) => pending . promise ) ;
167- const actor = createActor ( reverificationMachine , { context : { deps : effects } } ) . start ( ) ;
168- actor . send ( { type : 'START' , scope : { runId : Symbol ( ) , sessionId : 'session' } } ) ;
169- await tick ( ) ;
170- actor . send ( { type : 'SHOW_HELP' } ) ;
171- expect ( actor . getSnapshot ( ) . context . overlay ) . toEqual ( [ 'help' ] ) ;
172- expect ( actor . can ( { type : 'BACK' } ) ) . toBe ( true ) ;
173- actor . send ( { type : 'BACK' } ) ;
174- actor . send ( { type : 'SHOW_METHODS' } ) ;
175- actor . send ( { type : 'SELECT_METHOD' , id : work . id } ) ;
176- expect ( actor . can ( { type : 'BACK' } ) ) . toBe ( false ) ;
177- expect ( actor . can ( { type : 'SHOW_HELP' } ) ) . toBe ( false ) ;
178- actor . send ( { type : 'BACK' } ) ;
179- actor . send ( { type : 'SHOW_HELP' } ) ;
180- expect ( actor . getSnapshot ( ) . context . overlay ) . toEqual ( [ 'method-picker' ] ) ;
181- actor . stop ( ) ;
182- } ) ;
183-
184- it ( 'keeps help visible when the send behind it settles' , async ( ) => {
185- const effects = deps ( ) ;
186- const pending = deferred < ReverificationPreparation > ( ) ;
187- effects . prepare = vi . fn ( ( ) => pending . promise ) ;
188- const actor = createActor ( reverificationMachine , { context : { deps : effects } } ) . start ( ) ;
189- actor . send ( { type : 'START' , scope : { runId : Symbol ( ) , sessionId : 'session' } } ) ;
190- await tick ( ) ;
191- actor . send ( { type : 'SHOW_HELP' } ) ;
192- pending . resolve ( { reusableUntil : Date . now ( ) + 60_000 } ) ;
193- await tick ( ) ;
194- expect ( actor . getSnapshot ( ) . context . overlay ) . toEqual ( [ 'help' ] ) ;
195- expect ( actor . getSnapshot ( ) . context . operation ) . toBeNull ( ) ;
196- actor . send ( { type : 'BACK' } ) ;
197- expect ( actor . getSnapshot ( ) . context . overlay ) . toEqual ( [ ] ) ;
198- actor . stop ( ) ;
199- } ) ;
200- } ) ;
201-
202- it . each ( [ false , true ] ) (
203- 'keeps a picker opened over the original pending factor when the send settles (failure %s)' ,
204- async fails => {
205- const effects = deps ( ) ;
206- const pending = deferred < ReverificationPreparation > ( ) ;
207- effects . prepare = vi . fn ( ( ) => pending . promise ) ;
208- const actor = createActor ( reverificationMachine , { context : { deps : effects } } ) . start ( ) ;
209- actor . send ( { type : 'START' , scope : { runId : Symbol ( ) , sessionId : 'session' } } ) ;
210- await tick ( ) ;
211- actor . send ( { type : 'SHOW_METHODS' } ) ;
212- expect ( actor . can ( { type : 'BACK' } ) ) . toBe ( true ) ;
213- expect ( actor . can ( { type : 'SHOW_HELP' } ) ) . toBe ( true ) ;
214- if ( fails ) {
215- pending . reject ( { code : 'form_identifier_not_found' , message : 'Unknown identifier' } ) ;
216- } else {
217- pending . resolve ( { reusableUntil : Date . now ( ) + 60_000 } ) ;
218- }
219- await tick ( ) ;
220- expect ( actor . getSnapshot ( ) . context . overlay ) . toEqual ( [ 'method-picker' ] ) ;
221- actor . send ( { type : 'BACK' } ) ;
222- expect ( actor . getSnapshot ( ) . context . overlay ) . toEqual ( [ ] ) ;
223- actor . stop ( ) ;
224- } ,
225- ) ;
0 commit comments