 
 
   it 'should be destroyable with close icon', ->
-    mid = spark.utils.getUid()
-    oid = spark.utils.getUid()
-
-    modal.setDomId mid
-    modal.getOverlay().setDomId oid
-
-    expect(document.getElementById(mid)).not.toBeNull()
-    expect(document.getElementById(oid)).not.toBeNull()
+    expect(document.getElementById(modalId)).not.toBeNull()
+    expect(document.getElementById(overlayId)).not.toBeNull()
 
     closeIcon = modal.getElement().querySelector '.modal-close'
     fireClick closeIcon
 
-    expect(document.getElementById(mid)).toBeNull()
-    expect(document.getElementById(oid)).toBeNull()
+    expect(document.getElementById(modalId)).toBeNull()
+    expect(document.getElementById(overlayId)).toBeNull()
 
 
   it 'should be destroyed after calling destoy method', ->
-    mid = spark.utils.getUid()
-    oid = spark.utils.getUid()
-
-    modal.setDomId mid
-    modal.getOverlay().setDomId oid
-
-    expect(document.getElementById(mid)).not.toBeNull()
-    expect(document.getElementById(oid)).not.toBeNull()
+    expect(document.getElementById(modalId)).not.toBeNull()
+    expect(document.getElementById(overlayId)).not.toBeNull()
 
     modal.destroy()
 
-    expect(document.getElementById(mid)).toBeNull()
-    expect(document.getElementById(oid)).toBeNull()
+    expect(document.getElementById(modalId)).toBeNull()
+    expect(document.getElementById(overlayId)).toBeNull()

    m = new spark.components.Modal blocking: yes
    o = m.getOverlay()

    o.setDomId 'overrrlay'
    fireClick o.getElement()

    expect(document.getElementById('overrrlay')).not.toBeNull()

    m.removeFromDocument()


describe 'spark.components.Modal', ->

  modal     = null
  modalId   = null
  overlay   = null
  overlayId = null
  fireClick = (element) ->
    event = document.createEvent 'MouseEvents'
    event.initEvent 'click', yes, yes
