Kaynağa Gözat

condense tests into eventClick file

Adam Shaw 7 yıl önce
ebeveyn
işleme
0c7b1d2d60

+ 14 - 0
tests/automated/event-click-hover/eventClick.js

@@ -31,6 +31,7 @@ describe('eventClick', function() {
         { start: '2018-08-31', rendering: 'background' }
       ],
       eventClick(arg) {
+        expect(arg.event.rendering).toBe('background')
         done()
       }
     })
@@ -39,4 +40,17 @@ describe('eventClick', function() {
     getSingleBackgroundEventEl().simulate('click')
   })
 
+  it('works via touch', function(done) {
+    initCalendar({
+      events: [
+        { start: '2018-08-31' }
+      ],
+      eventClick() {
+        done()
+      }
+    })
+
+    getSingleEl().simulate('click')
+  })
+
 })

+ 0 - 36
tests/automated/legacy/eventClick.js

@@ -1,36 +0,0 @@
-
-describe('eventClick', function() {
-
-  pushOptions({
-    defaultDate: '2014-08-01'
-  })
-
-  it('works in month view', function(done) {
-    var options = {}
-    options.events = [
-      { start: '2014-08-01', title: 'event1', className: 'event1' }
-    ]
-    options.eventAfterAllRender = function() {
-      $('.event1').simulate('click')
-    }
-    options.eventClick = function() {
-      done()
-    }
-    initCalendar(options)
-  })
-
-  it('works in month view via touch', function(done) {
-    var options = {}
-    options.events = [
-      { start: '2014-08-01', title: 'event1', className: 'event1' }
-    ]
-    options.eventAfterAllRender = function() {
-      $.simulateTouchClick($('.event1'))
-    }
-    options.eventClick = function() {
-      done()
-    }
-    initCalendar(options)
-  })
-
-})