Open Bug 1745229 Opened 2 years ago Updated 2 years ago

Add calendar view tests

Categories

(Calendar :: Calendar Frontend, task)

Tracking

(Not tracked)

People

(Reporter: henry-x, Unassigned)

References

Details

This is just a list of calendar view features we don't have tests for.

This is mostly focussed on the multiday view because I'm working on bug 1713130 right now, and it has lots of features. Once I move onto bug 1738689 there's a chance we'll have more to add for the multiweek views.

As a general point, in the multiweek views, we don't run many tests in the rotated view. The exception is the tests in recurrence/browser_rotated.ini. In addition, we're missing tests for right-to-left displays. Rotation and right-to-left become particularly relevant for:

  • Positioning non-allday events.
  • Positioning of the "now" time indicator.
  • Dragging to create, resize or move events.
  • Scrolling the view.

Some existing tests where we can add rotation and right-to-left tests are timezones/browser_timezones.js (tests positioning) and browser_dragEventItem.js (test dragging) and views/browser_viewSwitch.js (mostly tests the scroll position and number of visible hours, despite the name).

Here are some specific features we don't have tests for (I'll update this with future edits as we work through them or find more):

I have not looked at this in a while but I think we should get rid of the custom drag and drop implementation if possible. If we decide to do this, I think some of those drag tests will have to be updated.

I have not looked at this in a while but I think we should get rid of the custom drag and drop implementation if possible

Can you elaborate on why we should remove it?

We should add to this list all tests to cover the invitation display, as well as the visibility state of the link in the status bar, recently fixed in bu 1754084

(In reply to Lasana Murray from comment #1)

I have not looked at this in a while but I think we should get rid of the custom drag and drop implementation if possible.

Are you referring to:

  1. dragging in the day columns in the multiday views (when dragType == "move"), or
  2. dragging between the all-day headers and dragging between the monthday boxes, or
  3. something else?

This:
https://searchfox.org/comm-central/rev/7b67182867d378db583e9b3f75313021e9045eac/calendar/base/content/calendar-multiday-view.js#203

It was a pain to test and difficult to follow when they broke. Not a priority but if possible they should use the drag and drop api instead of polling mousemoves. Likely not a trivial task though.

(In reply to Alessandro Castellani [:aleca] from comment #2)

We should add to this list all tests to cover the invitation display, as well as the visibility state of the link in the status bar, recently fixed in bu 1754084

Those won't fall under the calendar views. "Calendar views" is the tabular area that displays events on the calendar tab. The current invitation display has some tests already (I think) and more can be added when the enhancements are done. Let's hold off on too many tests for the link for now in case there are more changes to be made.

(In reply to Lasana Murray from comment #4)

This:
https://searchfox.org/comm-central/rev/7b67182867d378db583e9b3f75313021e9045eac/calendar/base/content/calendar-multiday-view.js#203

It was a pain to test and difficult to follow when they broke. Not a priority but if possible they should use the drag and drop api instead of polling mousemoves. Likely not a trivial task though.

We still need most of that mousedown/mousemove/mouseup code for dragging the starting and ending times, and for dragging to create an event. The "dragging" in this case is only a drag gesture, like drawing, and there is no transfer of data to be considered drag-and-drop. I already updated the corresponding test in this revision https://hg.mozilla.org/comm-central/rev/938a93cbea7d to use synthesizeMouseAtPoint. It is still a bit hacky, but it is better than it was.

Dragging to move an event, however, could use the drag-and-drop events so we can drag an event in or out of the multiday views (currently it is only one way https://searchfox.org/comm-central/rev/7b67182867d378db583e9b3f75313021e9045eac/calendar/base/content/calendar-multiday-view.js#903-923).

Note: all this will probably get moved around in bug 1738689 so I was going to wait until after that to properly consider drag-and-drop in the calendar.

You need to log in before you can comment on or make changes to this bug.