Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test -[IGListAdapter scrollToItem:...] #23

Closed
rnystrom opened this issue Sep 13, 2016 · 5 comments
Closed

Unit test -[IGListAdapter scrollToItem:...] #23

rnystrom opened this issue Sep 13, 2016 · 5 comments

Comments

@rnystrom
Copy link
Contributor

rnystrom commented Sep 13, 2016

This method is only tested manually and not backed by any type of automation. We should get a test up to make sure that all conditions pass:

  • Vertical/horizontal scrolling
  • No supplementary view
  • Single supplementary view
  • Multiple supplementary views
  • Empty feed
  • Item not in feed

(flagging as a bug since unit test coverage should be a requirement)

@yusuftor
Copy link

I'm trying to use this -[IGListAdapter scrollToObject:...] function (I assume it's the same one you're talking about?). I'm testing it in my view and it just doesn't scroll to any item at all. My code is:

adapter.scroll(to: model.content.last, supplementaryKinds: nil, scrollDirection: .vertical, animated: true)

Where model.content.last is an object being displayed in a section.

@zhubofei
Copy link

@rnystrom Can you change the bulleted list into a task list 🤔. So that we can work these out in separate PRs.

@rnystrom
Copy link
Contributor Author

@yusuftor could you create a new issue for this with an example?

@zhubofei sure thing! That will make it way easier to track.

@yusuftor
Copy link

@rnystrom False alarm! I realised that I needed to unwrap model.content.last and then it worked. However, I have noticed that it scrolls the item to the top of the view, with no option to specify whether you want it at the top or at the bottom. I'll create a new issue with that as a suggestion.

@zhubofei
Copy link

@rnystrom @jessesquires We can close this one 😏.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants