-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix for to being off by one #158
Conversation
app/components/blacklight/gallery/slideshow_preview_component.rb
Outdated
Show resolved
Hide resolved
app/components/blacklight/gallery/slideshow_preview_component.rb
Outdated
Show resolved
Hide resolved
30f251d
to
7065047
Compare
app/components/blacklight/gallery/slideshow_preview_component.rb
Outdated
Show resolved
Hide resolved
9fd0cea
to
21499fa
Compare
@@ -51,6 +51,14 @@ | |||
expect(rendered).to have_selector '.thumbnail img[@src="http://example.com/image.jpg"]' | |||
end | |||
|
|||
it 'renders the correct slide number' do | |||
if VIEW_COMPONENT_VERSION < 3 | |||
expect(rendered).to have_css '[data-slide-to=\"4\"][data-bs-slide-to=\"4\"]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the idea that these numbers should be the same regardless of what version of VC is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in the component.
It inherits from https://github.com/projectblacklight/blacklight/blob/v8.4.0/app/components/blacklight/document_component.rb#L26C1-L26C72
VIEW_COMPONENT_VERSION = 2, then the COLLECTION_INDEX_OFFSET = 0
VIEW_COMPONENT_VERSION = 3, then the COLLECTION_INDEX_OFFSET = 1
VIEW_COMPONENT_VERSION = 2, @count = 0 + 5 (document_counter, which we set in the test)
VIEW_COMPONENT_VERSION = 3, @count = 1 + 5 (document_counter, which we set in the test)
The component removes - 1 so it is right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so because the input will be different for each version, it's going to result in the same output.
closes #157
problem caused by 03721c4#diff-2014cfde3b1fa7bf929fade26c45c1a9a4328199617a56400c85b806e21f3964R7