Skip to content

Commit

Permalink
fix: test code of allday moveguide and code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsik Yoo committed Mar 21, 2018
1 parent c6886ad commit cf487a2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/view/week/taskview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
22 changes: 20 additions & 2 deletions test/app/handler/allday/moveGuide.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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);
Expand All @@ -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%
Expand Down

0 comments on commit cf487a2

Please sign in to comment.