Skip to content

Commit

Permalink
made snapshots match the new output (#13)
Browse files Browse the repository at this point in the history
* add type="button" to all buttons to not do a "submit" when used inside a form container

* made snapshots match the new output

* Update src/styled.tsx

Use .attrs instead of an anonymous component

Co-Authored-By: Kotaro Sugawara <[email protected]>

* Use default props instead

Co-authored-by: Kotaro Sugawara <[email protected]>
  • Loading branch information
nksaraf and kotarella1110 authored Mar 23, 2020
1 parent ee66078 commit 9e6cae5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/__snapshots__/devTool.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ exports[`DevTool render correctly 1`] = `
<button
class="css-7zizgu"
title="Close dev panel"
type="button"
>
</button>
Expand All @@ -38,13 +39,15 @@ exports[`DevTool render correctly 1`] = `
class="css-4vv12s"
style="border-right: 1px solid #0e101c; text-transform: none; font-size: 11px; line-height: 1;"
title="Update values and state the form"
type="button"
>
♺ UPDATE
</button>
<button
class="css-4vv12s"
style="border-right: 1px solid #0e101c; text-transform: none; font-size: 11px; line-height: 1;"
title="Toggle entire fields"
type="button"
>
[+] EXPAND
</button>
Expand Down Expand Up @@ -79,13 +82,15 @@ exports[`DevTool render correctly 1`] = `
class="css-4vv12s"
style="border: 1px solid #516391; border-radius: 2px; padding: 3px 5px; display: inline-block; font-size: 10px; line-height: 12px; width: 20px; text-align: center; margin-right: 10px;"
title="Toggle field table"
type="button"
>
+
</button>
<button
class="css-4vv12s"
style="border: 1px solid #516391; border-radius: 2px; padding: 3px 5px; display: inline-block; font-size: 10px; line-height: 12px; text-align: center; margin-right: 10px;"
title="Scroll into view"
type="button"
>
Native
</button>
Expand Down Expand Up @@ -124,13 +129,15 @@ exports[`DevTool render correctly 1`] = `
class="css-4vv12s"
style="border: 1px solid #516391; border-radius: 2px; padding: 3px 5px; display: inline-block; font-size: 10px; line-height: 12px; width: 20px; text-align: center; margin-right: 10px;"
title="Toggle field table"
type="button"
>
+
</button>
<button
class="css-4vv12s"
style="border: 1px solid #516391; border-radius: 2px; padding: 3px 5px; display: inline-block; font-size: 10px; line-height: 12px; text-align: center; margin-right: 10px;"
title="Scroll into view"
type="button"
>
Native
</button>
Expand All @@ -157,6 +164,7 @@ exports[`DevTool render correctly 1`] = `
class="css-4vv12s"
style="margin: 0px; width: 100%; padding: 8px 10px; text-transform: none; font-size: 12px; line-height: 14px;"
title="Toggle form state panel"
type="button"
>
<span
style="transition: 0.5s all; color: rgb(236, 89, 144);"
Expand Down
2 changes: 2 additions & 0 deletions src/__snapshots__/header.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ exports[`header should render correct color when form pass 1`] = `
<button
class="css-7zizgu"
title="Close dev panel"
type="button"
>
</button>
Expand All @@ -43,6 +44,7 @@ exports[`header should render correct when form failed 1`] = `
<button
class="css-7zizgu"
title="Close dev panel"
type="button"
>
</button>
Expand Down
2 changes: 2 additions & 0 deletions src/__snapshots__/panelTable.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ exports[`PanelTable should render correctly 1`] = `
class="css-4vv12s"
style="border: 1px solid #516391; border-radius: 2px; padding: 3px 5px; display: inline-block; font-size: 10px; line-height: 12px; width: 20px; text-align: center; margin-right: 10px;"
title="Toggle field table"
type="button"
>
+
</button>
<button
class="css-4vv12s"
style="border: 1px solid #516391; border-radius: 2px; padding: 3px 5px; display: inline-block; font-size: 10px; line-height: 12px; text-align: center; margin-right: 10px; cursor: not-allowed; background: rgb(81, 99, 145);"
title="Scroll into view"
type="button"
>
Custom
</button>
Expand Down
6 changes: 4 additions & 2 deletions src/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import styled from '@emotion/styled';
import colors from './colors';

export const paraGraphDefaultStyle = {
fontSize: 14,
lineHeight: '22px',
fontSize: 14,
lineHeight: '22px',
};

const Button = styled.button`
Expand All @@ -21,6 +21,8 @@ const Button = styled.button`
}
`;

Button.defaultProps = { type: 'button' };

const CircleButton = styled(Button)`
font-size: 14px;
font-weight: bold;
Expand Down

0 comments on commit 9e6cae5

Please sign in to comment.