   chapterHeading: (section) ->
     css: "#{OPENED_PANEL_SELECTOR} [data-chapter-section='#{section.split('.')[0]}'] > a"
 
+COMMON_DELETE_CONFIRM_ELEMENTS =
+  confirm:
+    css: '.btn.btn-primary'
+  cancel:
+    css: '.btn.btn-default'
 
 COMMON_UNSAVED_DIALOG_ELEMENTS =
   loadingState:

      @el.dismissButton().click()
      @waitUntilClose()


# Helper methods for dealing with the Reading Assignment Builder
# TODO this could probably be made into a BuilderHelper that extends the TestHelper
# and then the TaskBuilder and HomeworkBuilder can extend the BuilderHelper


        @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
