MosheBerman/MBCalendarKit

Unit Test Cell Width Code

Opened this issue · 0 comments

Summary

The calendar view divides the screen by the number of columns (always 7 for iOS calendar systems) in order to show the columns. If we just divide a an arbitrary view's width by 7, we'll often end up with floating point errors.

To work around this, MBCalendarKit finds the closest multiple of 7, and then redistributes the remaining pixels across the widths of the cells. The problem is that that there can be anywhere between 1 and 6 extra pixels and this code has not been tested visually or otherwise for all 6 cases.

The code that needs to be tested is in CKCalendarGridView.m.

Steps To Reproduce

  1. Install a calendar view in an arbitrarily sized view.
  2. Observe how the calendar sizes the cells.

Expected Results

The calendar should have all 6 cases tested and working reliably.

Actual Results

¯\(ツ)/¯ This code doesn't have unit tests yet.

Notes

I noticed a problem with some arbitrarily sized superview, so I think it's worth testing just for that alone.