File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,40 @@ function testButtonFunctions(testCase)
315315
316316
317317
318+ function testSortable(testCase )
319+
320+ % Get the listbox and button grid
321+ w = testCase .Widget ;
322+ listControl = testCase .Widget .ListBox ;
323+ buttonGrid = testCase .Widget .ListButtons ;
324+ button = buttonGrid .Button ;
325+
326+ % Add a list of items and put all on list
327+ testCase .verifySetProperty(" Value" , testCase .ItemNames );
328+
329+ % Select multiple items with mouse
330+ selIdx = [2 3 ];
331+ testCase .choose(listControl , selIdx )
332+
333+ % Move items further down
334+ testCase .press(button(4 ))
335+ testCase .press(button(4 ))
336+
337+ % Press down one too many
338+ testCase .press(button(4 ))
339+
340+ % Switch Sortable option off
341+ testCase .verifySetProperty(" Sortable" , false );
342+ testCase .verifyEquality(w .SelectedIndex , 1 : numel(testCase .ItemNames ));
343+
344+ % Switch Sortable option back on
345+ testCase .verifySetProperty(" Sortable" , true );
346+ testCase .verifyEquality(w .SelectedIndex , 1 : numel(testCase .ItemNames ));
347+
348+ end
349+
350+
351+
318352 function testUserButtons(testCase )
319353
320354 % Get the widget
You can’t perform that action at this time.
0 commit comments