'Scenario: Ensure that adding several XBlocks to a library results in pagination.
Given that I have a library in Studio with no XBlocks
And I create 10 Multiple Choice XBlocks
Then 10 are displayed.
When I add one more Multiple Choice XBlock
Then 1 XBlock will be displayed
When I delete that XBlock
Then 10 are displayed.'

def test_library_pagination(self):

    self.assertEqual(len(self.lib_page.xblocks), 0)
    for _ in range(10):
        add_component(self.lib_page, 'problem', 'Multiple    Choice')
    self.assertEqual(len(self.lib_page.xblocks), 10)
    add_component(self.lib_page, 'problem', 'Multiple    Choice')
    self.assertEqual(len(self.lib_page.xblocks), 1)
    self.lib_page.click_delete_button(self.lib_page.xblocks[0].locator)
    self.assertEqual(len(self.lib_page.xblocks), 10)
