From cf487a2cac31c26d2d2e4c76b4bd26d5c0a4e8e6 Mon Sep 17 00:00:00 2001 From: Dongsik Yoo Date: Wed, 21 Mar 2018 10:53:24 +0900 Subject: [PATCH] fix: test code of allday moveguide and code review --- src/js/view/week/taskview.js | 2 +- test/app/handler/allday/moveGuide.spec.js | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/js/view/week/taskview.js b/src/js/view/week/taskview.js index 4715cee6c..cdafa3e45 100644 --- a/src/js/view/week/taskview.js +++ b/src/js/view/week/taskview.js @@ -65,8 +65,8 @@ util.inherit(TaskView, View); TaskView.prototype.render = function(viewModel) { var container = this.container; var scheduleContainerTop = this.options.scheduleContainerTop; - var weekdayView; var self = this; + var weekdayView; container.innerHTML = tmpl(this.options); diff --git a/test/app/handler/allday/moveGuide.spec.js b/test/app/handler/allday/moveGuide.spec.js index 09b3007ad..7ec80e779 100644 --- a/test/app/handler/allday/moveGuide.spec.js +++ b/test/app/handler/allday/moveGuide.spec.js @@ -65,6 +65,22 @@ describe('handler:AlldayMoveGuide', function() { }); it('_onDrag can calculate guide element new width and left.', function() { + var grids = [{ + left: 0, + width: 20 + }, { + left: 20, + width: 20 + }, { + left: 40, + width: 20 + }, { + left: 60, + width: 20 + }, { + left: 80, + width: 20 + }]; // 2일짜리 일정을 inst.getScheduleDataFunc = inst._getScheduleBlockDataFunc({ model: { @@ -79,7 +95,8 @@ describe('handler:AlldayMoveGuide', function() { inst._dragStartXIndex = 0; inst._onDrag({ xIndex: 1, - datesInRange: 5 + datesInRange: 5, + grids: grids }); expect(inst.refreshGuideElement).toHaveBeenCalledWith(20, 40, false, false); @@ -99,7 +116,8 @@ describe('handler:AlldayMoveGuide', function() { inst._dragStartXIndex = 3; inst._onDrag({ xIndex: 4, - datesInRange: 5 + datesInRange: 5, + grids: grids }); // left: 40, width: 80 이지만 오른쪽으로 렌더링 범위를 초과했으므로 width는 60%