Adam Shaw пре 8 година
родитељ
комит
87366e42a9

+ 1 - 0
tests/legacy/background-events.js

@@ -1,3 +1,4 @@
+import { RED_REGEX } from '../lib/dom-utils';
 
 describe('background events', function() {
 

+ 2 - 0
tests/legacy/businessHours.js

@@ -1,5 +1,7 @@
 // most other businessHours tests are in background-events.js
 
+import { doElsMatchSegs, getBoundingRect } from '../lib/dom-utils';
+
 describe('businessHours', function() {
 	var options;
 

+ 2 - 0
tests/legacy/destroy.js

@@ -1,3 +1,5 @@
+import { countHandlers } from '../lib/dom-utils';
+
 describe('destroy', function() {
 
 	beforeEach(function() {

+ 1 - 0
tests/legacy/event-coloring.js

@@ -1,3 +1,4 @@
+import { RED_REGEX } from '../lib/dom-utils';
 
 describe('event coloring', function() {
 

+ 1 - 0
tests/legacy/external-dnd.js

@@ -1,3 +1,4 @@
+import { countHandlers } from '../lib/dom-utils';
 
 describe('external drag and drop', function() {
 

+ 1 - 0
tests/legacy/getClientRect.js

@@ -1,3 +1,4 @@
+import { getStockScrollbarWidths } from '../lib/dom-utils';
 
 describe('getClientRect', function() {
 

+ 1 - 0
tests/legacy/getScrollbarWidths.js

@@ -1,3 +1,4 @@
+import { getStockScrollbarWidths } from '../lib/dom-utils';
 
 describe('getScrollbarWidths', function() {
 

+ 2 - 0
tests/legacy/nowIndicator.js

@@ -1,3 +1,5 @@
+import { getBoundingRect } from '../lib/dom-utils';
+
 describe('now indicator', function() {
 	var FC = $.fullCalendar;
 	var options;

+ 7 - 7
tests/lib/dom-utils.js

@@ -1,10 +1,10 @@
 
-var RED_REGEX = /red|rgb\(255,\s*0,\s*0\)/;
-var GREEN_REGEX = /green|rgb\(0,\s*255,\s*0\)/;
-var BLUE_REGEX = /blue|rgb\(0,\s*0,\s*255\)/;
+export const RED_REGEX = /red|rgb\(255,\s*0,\s*0\)/;
+export const GREEN_REGEX = /green|rgb\(0,\s*255,\s*0\)/;
+export const BLUE_REGEX = /blue|rgb\(0,\s*0,\s*255\)/;
 
 
-function getStockScrollbarWidths(dir) {
+export function getStockScrollbarWidths(dir) {
 	var el = $('<div><div style="position:relative"/></div>')
 		.css({
 			position: 'absolute',
@@ -34,7 +34,7 @@ function getStockScrollbarWidths(dir) {
 }
 
 
-function countHandlers(el) {
+export function countHandlers(el) {
 	var hash = getHandlerHash(el);
 	var cnt = 0;
 
@@ -54,7 +54,7 @@ function getHandlerHash(el) {
 /* copied from other proj
 ----------------------------------------------------------------------------------------------------------------------*/
 
-function doElsMatchSegs(els, segs, segToRectFunc) {
+export function doElsMatchSegs(els, segs, segToRectFunc) {
 	var elRect, found, i, j, k, len, len1, seg, segRect, unmatchedRects;
 	unmatchedRects = getBoundingRects(els);
 	if (unmatchedRects.length !== segs.length) {
@@ -92,7 +92,7 @@ function getBoundingRects(els) {
 	})();
 }
 
-function getBoundingRect(el) {
+export function getBoundingRect(el) {
 	var rect;
 	el = $(el);
 	expect(el.length).toBe(1);

+ 1 - 1
tests/lib/time-grid.js

@@ -1,6 +1,6 @@
-
 // TODO: consolidate with scheduler
 
+import { getBoundingRect } from '../lib/dom-utils';
 
 function dragTimeGridEvent(eventEl, dropDate) {
 	return new Promise(function(resolve) {