Fix drag and drop onto minical
Fixes CNVS-26396 Test plan: - Create a calendar event - Drag it onto a different day on the minical - Ensure it moves - Reload the page - Ensure it's still on the new date Change-Id: I407bf2dc9f28b469a96fbd4f65937e80bbd3a786 Reviewed-on: https://gerrit.instructure.com/73658 Tested-by: Jenkins Reviewed-by: Jeremy Stanley <jeremy@instructure.com> QA-Review: Heath Hales <hhales@instructure.com> Product-Review: Alex Boyd <aboyd@instructure.com>
This commit is contained in:
parent
d1211c0fb9
commit
67a9886cf0
|
@ -411,7 +411,7 @@ define [
|
||||||
originalEnd = fcUtil.clone(event.end)
|
originalEnd = fcUtil.clone(event.end)
|
||||||
@copyYMD(event.start, date)
|
@copyYMD(event.start, date)
|
||||||
@copyYMD(event.end, date)
|
@copyYMD(event.end, date)
|
||||||
@_eventDrop(event, 0, false, =>
|
@_eventDrop(event, moment.duration(event.start.diff(originalStart)).asMinutes(), false, =>
|
||||||
event.start = originalStart
|
event.start = originalStart
|
||||||
event.end = originalEnd
|
event.end = originalEnd
|
||||||
@updateEvent(event)
|
@updateEvent(event)
|
||||||
|
|
|
@ -85,6 +85,7 @@ describe "calendar2" do
|
||||||
@initial_time = Time.zone.parse('2015-1-1').beginning_of_day + 9.hours
|
@initial_time = Time.zone.parse('2015-1-1').beginning_of_day + 9.hours
|
||||||
@initial_time_str = @initial_time.strftime('%Y-%m-%d')
|
@initial_time_str = @initial_time.strftime('%Y-%m-%d')
|
||||||
@one_day_later = @initial_time + 24.hours
|
@one_day_later = @initial_time + 24.hours
|
||||||
|
@one_day_later_str = @one_day_later.strftime('%Y-%m-%d')
|
||||||
@three_days_earlier = @initial_time - 72.hours
|
@three_days_earlier = @initial_time - 72.hours
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -206,6 +207,22 @@ describe "calendar2" do
|
||||||
extended_day_text = format_time_for_view(date_of_next_day.to_datetime + 1.day)
|
extended_day_text = format_time_for_view(date_of_next_day.to_datetime + 1.day)
|
||||||
expect(f('.event-details-timestring .date-range').text).to eq("#{original_day_text} - #{extended_day_text}")
|
expect(f('.event-details-timestring .date-range').text).to eq("#{original_day_text} - #{extended_day_text}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "allows dropping onto the minical" do
|
||||||
|
# fullcalendar drop onto minical doesn't work under webpack. We should figure out why...
|
||||||
|
pending("fullcalendar drop onto minical doesn't work under webpack") if CANVAS_WEBPACK
|
||||||
|
|
||||||
|
event = make_event(start: @initial_time)
|
||||||
|
load_month_view
|
||||||
|
quick_jump_to_date(@initial_time_str)
|
||||||
|
|
||||||
|
drag_and_drop_element(f('.calendar .fc-event'), fj("#minical .fc-day-number[data-date=#{@one_day_later_str}]"))
|
||||||
|
keep_trying_until { fj("#minical .fc-bg .fc-day.event[data-date=#{@one_day_later_str}]") }
|
||||||
|
wait_for_ajaximations
|
||||||
|
|
||||||
|
event.reload
|
||||||
|
expect(event.start_at).to eq(@one_day_later)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "more options link should go to calendar event edit page" do
|
it "more options link should go to calendar event edit page" do
|
||||||
|
|
Loading…
Reference in New Issue