-
Notifications
You must be signed in to change notification settings - Fork 219
Fix/dont rename non cloudinary props #181
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
Conversation
if (!isInView && this.shouldLazyLoad(options)) { | ||
attributes.dataSrc = attributes.dataSrc || attributes.src; | ||
attributes['data-src'] = attributes.dataSrc || attributes.src; |
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.
@maoznir , why do we need this line AND lines 61-64?
const {cloudinaryProps, cloudinaryReactProps, nonCloudinaryProps} = extractCloudinaryProps(options); | ||
options = {...cloudinaryProps, ...cloudinaryReactProps}; | ||
|
||
//const snakeCaseOptions = toSnakeCaseKeys(options); |
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.
Please remove
let tagAttributes = cld.videoTag(publicId, options).attributes(); | ||
tagAttributes = {...Util.withCamelCaseKeys(tagAttributes), ...nonCloudinaryProps}; |
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.
You have the cloudinary+react props in options
and the non-cloudinary props in nonCloudinaryProps
, why do we need to create a tag for getting those tagAttributes
?
@@ -94,6 +94,14 @@ describe('Image', () => { | |||
|
|||
expect(tag.find('img').prop('src')).to.match(/fn_wasm:blur.wasm\/sample/); | |||
}); | |||
it('should not change kebab-case param names', () => { |
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.
it('should not change kebab-case for non-cloudinary param names', () => {
); | ||
|
||
expect(tag.find('img').prop('data-testid')).to.equal('testing'); | ||
expect(tag.find('img').prop('datatestid')).to.equal(undefined); |
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.
dataTestid
@@ -190,4 +190,13 @@ describe('Video', () => { | |||
expect(video.prop('plays_inline')).to.equal(undefined); | |||
expect(video.prop('auto_play')).to.equal(undefined); | |||
}); | |||
it('should not change kebab-case param names', () => { |
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.
it('should not change kebab-case for non-cloudinary param names', () => {
|
||
const video = tag.find('video'); | ||
expect(video.prop('data-testid')).to.equal("testing"); | ||
expect(video.prop('datatestid')).to.equal(undefined); |
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.
dataTestid
No description provided.