-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update of label from pagination (#920)
* fix: update of label from pagination * fix: adding test for b3table
- Loading branch information
Showing
11 changed files
with
1,045 additions
and
10,487 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { LangProvider } from '@b3/lang' | ||
import { describe, expect, it } from 'vitest' | ||
|
||
import { B3Table } from '@/components' | ||
import { TableColumnItem } from '@/components/table/B3Table' | ||
import lang from '@/store/slices/lang' | ||
|
||
import { renderWithProviders } from '../../test-utils' | ||
|
||
const columnItems: TableColumnItem<1> = { | ||
key: 'key test1', | ||
title: 'title test', | ||
} | ||
|
||
const listItems = [ | ||
{ | ||
node: { | ||
id: 1, | ||
}, | ||
}, | ||
] | ||
|
||
describe('B3Table component', async () => { | ||
it('renders correctly', () => { | ||
renderWithProviders( | ||
<LangProvider customText={{ 'global.pagination.of': 'test-of' }}> | ||
<B3Table | ||
tableFixed | ||
columnItems={[columnItems]} | ||
listItems={listItems} | ||
pagination={{ | ||
offset: 0, | ||
count: 0, | ||
first: 10, | ||
}} | ||
rowsPerPageOptions={[10, 20, 50]} | ||
showPagination | ||
labelRowsPerPage="cards per page" | ||
/> | ||
</LangProvider>, | ||
{ | ||
reducers: { lang }, | ||
} | ||
) | ||
}) | ||
|
||
it('matching b3table with snapshot', () => { | ||
const { result } = renderWithProviders( | ||
<LangProvider customText={{ 'global.pagination.of': 'test-of' }}> | ||
<B3Table | ||
tableFixed | ||
columnItems={[columnItems]} | ||
listItems={listItems} | ||
pagination={{ | ||
offset: 0, | ||
count: 0, | ||
first: 10, | ||
}} | ||
rowsPerPageOptions={[10, 20, 50]} | ||
showPagination | ||
labelRowsPerPage="cards per page" | ||
isInfiniteScroll={false} | ||
isCustomRender={false} | ||
/> | ||
</LangProvider>, | ||
{ | ||
reducers: { lang }, | ||
} | ||
) | ||
expect(result).toMatchSnapshot() | ||
}) | ||
}) |
Oops, something went wrong.