fluent-kit icon indicating copy to clipboard operation
fluent-kit copied to clipboard

Add `hasNext` and `hasPrevious` properties

Open noahpistilli opened this issue 3 years ago • 4 comments

This PR adds the properties hasNext and hasPrevious which are similar to the flask-sqlalchemy properties has_next and has_prev.

noahpistilli avatar Feb 07 '22 03:02 noahpistilli

Can you add some tests to this? Especially to check the boundaries/edge cases. Like count of 0, trying to pass in a page of -1 etc

0xTim avatar Feb 17 '22 16:02 0xTim

Can you add some tests to this? Especially to check the boundaries/edge cases. Like count of 0, trying to pass in a page of -1 etc

Should I add bounds to PageMetadata.page and PageMetadata.per then? Right now it will gladly accept a negative page number and a value of 0

noahpistilli avatar Feb 20 '24 02:02 noahpistilli

Can you add some tests to this? Especially to check the boundaries/edge cases. Like count of 0, trying to pass in a page of -1 etc

Should I add bounds to PageMetadata.page and PageMetadata.per then? Right now it will gladly accept a negative page number and a value of 0

Yes we definitely need tests and count checking for this

0xTim avatar Feb 20 '24 13:02 0xTim

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (bb47433) 47.39% compared to head (affcd01) 47.52%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #482      +/-   ##
==========================================
+ Coverage   47.39%   47.52%   +0.13%     
==========================================
  Files         106      106              
  Lines        4756     4768      +12     
==========================================
+ Hits         2254     2266      +12     
  Misses       2502     2502              
Files Coverage Δ
...luentKit/Query/Builder/QueryBuilder+Paginate.swift 80.00% <100.00%> (+5.00%) :arrow_up:

codecov-commenter avatar Feb 20 '24 15:02 codecov-commenter