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 @@ -216,7 +216,7 @@ const styles = StyleSheet.create({
overflow: 'hidden',
},
touchable: {
flexGrow: 1,
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,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 @@ -425,7 +425,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 @@ -647,7 +647,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -869,7 +869,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1126,7 +1126,7 @@ exports[`AppbarAction should be rendered with custom color 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1384,7 +1384,7 @@ exports[`AppbarAction should be rendered with default theme color 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1642,7 +1642,7 @@ exports[`AppbarAction should be rendered with specific theme color if is leading
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1901,7 +1901,7 @@ exports[`AppbarAction should render AppbarBackAction with custom color 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
14 changes: 13 additions & 1 deletion src/components/__tests__/IconButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { StyleSheet } from 'react-native';

import { describe, expect, it } from '@jest/globals';

import { render } from '../../test-utils';
import { render, screen } from '../../test-utils';
import { pink500 } from '../../theme/colors';
import { LightTheme } from '../../theme/schemes';
import { tokens } from '../../theme/tokens';
Expand All @@ -18,6 +18,9 @@ const styles = StyleSheet.create({
slightlyRounded: {
borderRadius: 4,
},
customBackground: {
backgroundColor: pink500,
},
});

it('renders icon button by default', async () => {
Expand Down Expand Up @@ -80,6 +83,15 @@ it('renders icon button with small border radius', async () => {
expect(toJSON()).toMatchSnapshot();
});

it('keeps touchable content centered with custom container style', async () => {
await render(<IconButton icon="delete" style={styles.customBackground} />);
expect(screen.getByRole('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 @@ -752,7 +752,7 @@ exports[`DataTable.Pagination renders data table pagination 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -870,7 +870,7 @@ exports[`DataTable.Pagination renders data table pagination 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1046,7 +1046,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 @@ -1164,7 +1164,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 @@ -1282,7 +1282,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 @@ -1400,7 +1400,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 @@ -1576,7 +1576,7 @@ exports[`DataTable.Pagination renders data table pagination with label 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1694,7 +1694,7 @@ exports[`DataTable.Pagination renders data table pagination with label 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -2168,7 +2168,7 @@ exports[`DataTable.Pagination renders data table pagination with options select
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -2286,7 +2286,7 @@ exports[`DataTable.Pagination renders data table pagination with options select
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -2404,7 +2404,7 @@ exports[`DataTable.Pagination renders data table pagination with options select
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -2522,7 +2522,7 @@ exports[`DataTable.Pagination renders data table pagination with options select
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
14 changes: 7 additions & 7 deletions src/components/__tests__/__snapshots__/IconButton.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ exports[`renders disabled icon button 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -191,7 +191,7 @@ exports[`renders icon button by default 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -311,7 +311,7 @@ exports[`renders icon button with color 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -433,7 +433,7 @@ exports[`renders icon button with custom border radius 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -554,7 +554,7 @@ exports[`renders icon button with size 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -676,7 +676,7 @@ exports[`renders icon button with small border radius 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -797,7 +797,7 @@ exports[`renders icon change animated 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
14 changes: 7 additions & 7 deletions src/components/__tests__/__snapshots__/Searchbar.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ exports[`activity indicator snapshot test 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -600,7 +600,7 @@ exports[`renders searchbar in "view" mode 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -766,7 +766,7 @@ exports[`renders searchbar in "view" mode 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1003,7 +1003,7 @@ exports[`renders with placeholder 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1169,7 +1169,7 @@ exports[`renders with placeholder 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1381,7 +1381,7 @@ exports[`renders with text 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down Expand Up @@ -1543,7 +1543,7 @@ exports[`renders with text 1`] = `
[
{
"alignItems": "center",
"flexGrow": 1,
"flex": 1,
"justifyContent": "center",
},
undefined,
Expand Down
Loading