-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08e2c54
commit e8d90c3
Showing
10 changed files
with
7,904 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
packages/blade/src/components/Table/__tests__/Table.native.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* eslint-disable @typescript-eslint/no-empty-function */ | ||
import React from 'react'; | ||
import { Table } from '../Table'; | ||
import type { TableProps } from '../types'; | ||
import { TableBody, TableRow, TableCell } from '../TableBody'; | ||
import renderWithTheme from '~utils/testing/renderWithTheme.native'; | ||
|
||
const data: TableProps<{ name: string; id: string }>['data'] = { | ||
nodes: [ | ||
{ | ||
name: 'John Doe', | ||
id: '1', | ||
}, | ||
], | ||
}; | ||
|
||
describe('Table', () => { | ||
it('renders proper information on unavailability of Table on native', () => { | ||
const mockConsoleWarn = jest.spyOn(console, 'warn').mockImplementation(); | ||
|
||
const { getByText } = renderWithTheme( | ||
<Table data={data}> | ||
{(tableData) => ( | ||
<TableBody> | ||
<TableRow item={tableData[0]}> | ||
<TableCell>Cell 1</TableCell> | ||
</TableRow> | ||
</TableBody> | ||
)} | ||
</Table>, | ||
); | ||
expect(getByText('Table Component is not available for Native mobile apps.')).toBeTruthy(); | ||
expect(console.warn).toHaveBeenCalledWith( | ||
'[Blade: Table]: Table Component is not available for Native mobile apps.', | ||
); | ||
mockConsoleWarn.mockRestore(); | ||
}); | ||
}); |
Oops, something went wrong.