Skip to content

Commit

Permalink
Merge pull request #61 from kodiak-packages/button-name-prop
Browse files Browse the repository at this point in the history
Add name prop to button
  • Loading branch information
RobinWijnant authored Jul 21, 2020
2 parents 9af70ad + 4bf2964 commit 661e7f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const Button: React.FC<Props> = ({
className={buttonClassNames}
type={htmlType}
onClick={isLoading || suffixIcon ? undefined : onClick}
name={name}
data-testid={`button-${name}`}
>
{isLoading ? <Spinner className={styles.spinner} /> : prefixIcon}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Button/__snapshots__/Button.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`Button button should have type="submit" 1`] = `
<button
class="ventura button typePrimary"
data-testid="button-test"
name="test"
type="submit"
>
<span
Expand Down Expand Up @@ -38,6 +39,7 @@ exports[`Button loading button 1`] = `
class="ventura button typePrimary"
data-testid="button-loading"
disabled=""
name="loading"
type="button"
>
<svg
Expand Down

0 comments on commit 661e7f8

Please sign in to comment.