Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ const styles = StyleSheet.create({
elevation: 0,
},
touchable: {
flexGrow: 1,
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -360,7 +360,7 @@ exports[`Appbar does not pass any additional props to Searchbar 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -549,7 +549,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -792,7 +792,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
19 changes: 19 additions & 0 deletions src/components/__tests__/IconButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const styles = StyleSheet.create({
slightlyRounded: {
borderRadius: 4,
},
customBackground: {
backgroundColor: pink500,
},
});

it('renders icon button by default', async () => {
Expand Down Expand Up @@ -85,6 +88,22 @@ it('renders icon button with small border radius', async () => {
});
});

it('keeps touchable content centered with custom container style', async () => {
await render(
<IconButton
icon="delete"
testID="icon-button"
style={styles.customBackground}
/>
);

expect(screen.getByTestId('icon-button')).toHaveStyle({
flex: 1,
justifyContent: 'center',
alignItems: 'center',
});
});

describe('getIconButtonColor - icon color', () => {
it('should return custom icon color', () => {
expect(
Expand Down
24 changes: 12 additions & 12 deletions src/components/__tests__/__snapshots__/DataTable.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ exports[`DataTable.Pagination renders data table pagination 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -610,7 +610,7 @@ exports[`DataTable.Pagination renders data table pagination 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -808,7 +808,7 @@ exports[`DataTable.Pagination renders data table pagination with fast-forward bu
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -948,7 +948,7 @@ exports[`DataTable.Pagination renders data table pagination with fast-forward bu
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1088,7 +1088,7 @@ exports[`DataTable.Pagination renders data table pagination with fast-forward bu
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1228,7 +1228,7 @@ exports[`DataTable.Pagination renders data table pagination with fast-forward bu
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1426,7 +1426,7 @@ exports[`DataTable.Pagination renders data table pagination with label 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1566,7 +1566,7 @@ exports[`DataTable.Pagination renders data table pagination with label 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -2012,7 +2012,7 @@ exports[`DataTable.Pagination renders data table pagination with options select
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -2152,7 +2152,7 @@ exports[`DataTable.Pagination renders data table pagination with options select
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -2292,7 +2292,7 @@ exports[`DataTable.Pagination renders data table pagination with options select
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -2432,7 +2432,7 @@ exports[`DataTable.Pagination renders data table pagination with options select
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
10 changes: 5 additions & 5 deletions src/components/__tests__/__snapshots__/IconButton.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ exports[`renders disabled icon button 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -233,7 +233,7 @@ exports[`renders icon button by default 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -375,7 +375,7 @@ exports[`renders icon button with color 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -517,7 +517,7 @@ exports[`renders icon button with size 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -659,7 +659,7 @@ exports[`renders icon change animated 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
10 changes: 5 additions & 5 deletions src/components/__tests__/__snapshots__/Searchbar.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ exports[`activity indicator snapshot test 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -541,7 +541,7 @@ exports[`renders with placeholder 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -731,7 +731,7 @@ exports[`renders with placeholder 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -914,7 +914,7 @@ exports[`renders with text 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1100,7 +1100,7 @@ exports[`renders with text 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
16 changes: 8 additions & 8 deletions src/components/__tests__/__snapshots__/TextInput.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ exports[`renders filled TextInput with TextInput.Icon accessories 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -441,7 +441,7 @@ exports[`renders filled TextInput with TextInput.Icon accessories 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -738,7 +738,7 @@ exports[`renders filled TextInput with TextInput.Icon accessories when error is
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -943,7 +943,7 @@ exports[`renders filled TextInput with TextInput.Icon accessories when error is
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1417,7 +1417,7 @@ exports[`renders outlined TextInput with TextInput.Icon accessories 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1622,7 +1622,7 @@ exports[`renders outlined TextInput with TextInput.Icon accessories 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1900,7 +1900,7 @@ exports[`renders outlined TextInput with TextInput.Icon accessories when error i
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -2105,7 +2105,7 @@ exports[`renders outlined TextInput with TextInput.Icon accessories when error i
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ exports[`renders disabled toggle button 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -229,7 +229,7 @@ exports[`renders toggle button 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -369,7 +369,7 @@ exports[`renders unchecked toggle button 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down