Преглед изворни кода

some more test utils added

Adam Shaw пре 8 година
родитељ
комит
0481ec01aa
2 измењених фајлова са 14 додато и 0 уклоњено
  1. 8 0
      tests/globals.js
  2. 6 0
      tests/lib/time-grid.js

+ 8 - 0
tests/globals.js

@@ -202,3 +202,11 @@ window.spyOnMethod = function(Class, methodName, dontCallThrough) {
 
   return spy
 }
+
+// wraps an existing function in a spy, calling through to the function
+window.spyCall = function(func) {
+  func = func || function() {}
+  const obj = { func }
+  spyOn(obj, 'func').and.callThrough()
+  return obj.func
+}

+ 6 - 0
tests/lib/time-grid.js

@@ -148,3 +148,9 @@ export function getTimeGridSlotEls(timeDuration) {
     return $()
   }
 }
+
+
+// TODO: discourage use
+export function getTimeGridDowEls(dayAbbrev) {
+  return $(`.fc-time-grid .fc-day.fc-${dayAbbrev}`)
+}