File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -533,3 +533,23 @@ function test.key_back_should_scroll_previous_tab_into_view_if_necessary_when_wr
533
533
expect .eq (tb :get_cur_page (), 3 , ' key back should select the previous tab' )
534
534
expect .gt (tb .scroll_offset , scroll_offset_before_input , ' key back should scroll the previous tab into view' )
535
535
end
536
+
537
+ function test .scroll_offset_is_reset_if_width_changes ()
538
+ local tb = setup ({frame_width = 10 })
539
+
540
+ tb :postComputeFrame ({t = 0 ,l = 0 ,width = 100 })
541
+
542
+ expect .eq (tb .scroll_offset , 0 , ' scroll offset should be reset when parent frame width changes' )
543
+
544
+ tb .scroll_offset = - 50
545
+
546
+ tb :postComputeFrame ({t = 0 ,l = 0 ,width = 100 })
547
+
548
+ expect .eq (tb .scroll_offset , - 50 , ' scroll offset should not be reset when parent frame width does not change' )
549
+ end
550
+
551
+ function test .offset_to_show_last_tab_is_calculated_on_first_render ()
552
+ local tb = setup ({frame_width = 10 })
553
+
554
+ expect .lt (tb .offset_to_show_last_tab , 0 , ' offset_to_show_last_tab should be calculated on first render' )
555
+ end
You can’t perform that action at this time.
0 commit comments