forked from openlp/openlp
Fix slide order change when splitting custom slides. Fixes bug 1554748.
Fixes: https://launchpad.net/bugs/1554748
This commit is contained in:
parent
faa434d937
commit
e908799240
@ -198,6 +198,7 @@ class EditCustomForm(QtWidgets.QDialog, Ui_CustomEditDialog):
|
|||||||
# Insert all slides to make the old_slides list complete.
|
# Insert all slides to make the old_slides list complete.
|
||||||
for slide in slides:
|
for slide in slides:
|
||||||
old_slides.insert(old_row, slide)
|
old_slides.insert(old_row, slide)
|
||||||
|
old_row += 1
|
||||||
self.slide_list_view.addItems(old_slides)
|
self.slide_list_view.addItems(old_slides)
|
||||||
self.slide_list_view.repaint()
|
self.slide_list_view.repaint()
|
||||||
|
|
||||||
|
@ -128,3 +128,19 @@ class TestEditCustomForm(TestCase, TestMixin):
|
|||||||
# THEN: The validate method should have returned False.
|
# THEN: The validate method should have returned False.
|
||||||
assert not result, 'The _validate() method should have retured False'
|
assert not result, 'The _validate() method should have retured False'
|
||||||
mocked_critical_error_message_box.assert_called_with(message='You need to add at least one slide.')
|
mocked_critical_error_message_box.assert_called_with(message='You need to add at least one slide.')
|
||||||
|
|
||||||
|
def update_slide_list_test(self):
|
||||||
|
"""
|
||||||
|
Test the update_slide_list() method
|
||||||
|
"""
|
||||||
|
# GIVEN: Mocked slide_list_view with a slide with 3 lines
|
||||||
|
self.form.slide_list_view = MagicMock()
|
||||||
|
self.form.slide_list_view.count.return_value = 1
|
||||||
|
self.form.slide_list_view.currentRow.return_value = 0
|
||||||
|
self.form.slide_list_view.item.return_value = MagicMock(return_value='1st Slide\n2nd Slide\n3rd Slide')
|
||||||
|
|
||||||
|
# WHEN: updating the slide by splitting the lines into slides
|
||||||
|
self.form.update_slide_list(['1st Slide', '2nd Slide', '3rd Slide'])
|
||||||
|
|
||||||
|
# THEN: The slides should be created in correct order
|
||||||
|
self.form.slide_list_view.addItems.assert_called_with(['1st Slide', '2nd Slide', '3rd Slide'])
|
||||||
|
Loading…
Reference in New Issue
Block a user