 
         @el.sectionItem(section).waitClick()
 
+class DeleteConfirmPopover extends TestHelper
+  constructor: (test, testElementLocator) ->
+    testElementLocator ?= css: '.popover.openstax-surety-guard'
+    super test, testElementLocator, COMMON_DELETE_CONFIRM_ELEMENTS
+
+  confirm: =>
+    @el.self().isPresent().then (popoverIsOpen) =>
+      return unless popoverIsOpen
+      @waitUntilLoaded()
+      @el.confirm().click()
+      @waitUntilClose()
+
+  waitUntilClose: =>
+    @test.driver.wait =>
+      @el.self().isPresent().then (isPresent) -> not isPresent
+
 
 # TODO could probably make this a general dialog/modal helper to extend from.
 class UnsavedDialog extends TestHelper

  chapterHeading: (section) ->
    css: "#{OPENED_PANEL_SELECTOR} [data-chapter-section='#{section.split('.')[0]}'] > a"


COMMON_UNSAVED_DIALOG_ELEMENTS =
  loadingState:

    # Wait up to 2min for delete to complete
    @el.deleteButton().waitClick(2 * 60 * 1000)
    # Accept the browser confirm dialog
    @el.deleteConfirmation.waitUntilLoaded()
    @el.deleteConfirmation.confirm()
    Calendar.verify(@test, 2 * 60 * 100)


