feat(slidesInView): separation of concerns + added method to public api#51
Open
pimdewit wants to merge 2 commits intociampo:masterfrom
Open
feat(slidesInView): separation of concerns + added method to public api#51pimdewit wants to merge 2 commits intociampo:masterfrom
pimdewit wants to merge 2 commits intociampo:masterfrom
Conversation
Pull Request Test Coverage Report for Build 68
💛 - Coveralls |
ciampo
requested changes
Oct 9, 2019
Owner
ciampo
left a comment
There was a problem hiding this comment.
- needs more tests (as per my comment)
- we should consider refactoring other parts of the code that kind of perform the same calculation (like in the
slidesStatusCaptionfunction and in theattributeChangedfunction - we should add docs for this property (and specify it's read-only) (actually, because there is no setter, what happens when writing the value of the property?)
|
|
||
| await wcutils.flush(); | ||
| expect(this.slider.slidesInView).to.deep.equal([0, 1, 2]); | ||
| }); |
Owner
There was a problem hiding this comment.
We need more tests:
- with different values of selected (not just
0) - with different values of
slidesPerView(definitely at least1as well)
And then we need to test for edge cases:
- what if
selectedis set on purpose out of range? (e.g. there are 5 slides, and we setselectedto7) - what if
slidesPerViewis set to0? - what if looping is enabled, and the
selectedslide is the last?slidesInViewshould be[last, first...]
Any anything else that comes to mind
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I thought
slidesInViewwould be a nice addition to the public API, it is also a nice opportunity for separation of concerns. I extracted the snippet from_updateSlidesA11yand added it to its own getter.