You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.
I was trying to customise the GoogleLogin button's styles, and found out that this is not possible. As any programmer would, I decided to fork the repo and do it myself.
Upon completion, I ran the test suite and saw that it's intended for the styles not to work?
This is the message I got when i ran npm test:
This is despite a custom style being set in the tests, as shown below:
tests/google-login.test.js
Line 98, in test suite "With custom class and custom style":
describe('With custom class and custom style',()=>{constclassName='test-class'conststyle={color: 'red'}constprops={onSuccess(){},
...
Essentially, there is custom styles being set, yet they are not expected to be set on the rendered button.
This was the root of my problem, and I don't understand why this would be the intended behaviour. Feel free to correct me if there is a valid reason
Pull request link
Problem
I was trying to customise the
GoogleLogin
button's styles, and found out that this is not possible. As any programmer would, I decided to fork the repo and do it myself.Upon completion, I ran the test suite and saw that it's intended for the styles not to work?
This is the message I got when i ran
npm test
:This is despite a custom style being set in the tests, as shown below:
tests/google-login.test.js
Line 98, in test suite "With custom class and custom style":
Essentially, there is custom styles being set, yet they are not expected to be set on the rendered button.
This was the root of my problem, and I don't understand why this would be the intended behaviour. Feel free to correct me if there is a valid reason
Fixes
Below are the fixes that I made to my repo:
src/google-login.js
Line 19, in props destructuring:
... disabledStyle, + style, buttonText, ...
Line 85, after
initialStyles
definition:test/snapshots/google-login.test.js.snap
Line 111, in "Google Login With custom class and custom style has inline styles 1" snapshot:
Line: 137, in "Google Login With custom class and custom style render the button 1" snapshot:
Result
With these amendments, the following is now possible:
Before
After
The text was updated successfully, but these errors were encountered: