Skip to content

Commit 6afa7d3

Browse files
authored
Merge pull request #103 from samuel-gomez/feature/fix-cover-table
fix(table): cover and clean
2 parents d5c6a0a + 41549d3 commit 6afa7d3

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

scripts/clean.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ const pathsDelete = [
3030
'./src/pages/Home/Galleries',
3131
'./src/assets',
3232
'./src/shared/testsUtils/clearString.ts',
33-
'./src/shared/toolkit.ts',
3433
'./src/shared/components/LiveCode',
3534
'./src/shared/components/Cards',
3635
'./src/shared/components/LazyImage',
3736
'./src/shared/components/DownloadLink',
3837
'./src/shared/components/Editor',
39-
'./src/shared/components/testsUtils/clearString.ts',
4038
'./src/pages/Demos',
4139
'./features/Demos',
4240
'renovate.json',

src/shared/components/Table/Headers/Header/__tests__/Header.test.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,18 @@ describe('Header', () => {
1616
within(baseElement).getByRole(scope === 'col' || scope === undefined ? 'columnheader' : 'rowheader');
1717
screen.getByText('label');
1818
});
19+
20+
it('Should render Header with class "af-table__th--blank" when isBlank is true', () => {
21+
const { baseElement } = renderWithContainer(<Header isBlank />, container);
22+
23+
const header = within(baseElement).getByRole('columnheader');
24+
expect(header).toHaveClass('af-table__th af-table__th--blank');
25+
});
26+
27+
it('Should render Header without class "af-table__th--blank" when isBlank is false', () => {
28+
const { baseElement } = renderWithContainer(<Header isBlank={false} />, container);
29+
30+
const header = within(baseElement).getByRole('columnheader');
31+
expect(header).toHaveClass('af-table__th');
32+
});
1933
});

src/shared/testsUtils/sharedScenarios/table/utils.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ export const expectTable = async (tableItemsType = DEFAULT_TABLE_ITEMS_TYPE) =>
4343
};
4444

4545
export const expectCellsContent = (cells: HTMLElement[], ...args: string[]) => {
46-
args
46+
const argsWithoutLast = [...args];
47+
argsWithoutLast.pop();
48+
49+
argsWithoutLast
4750
.filter(item => !isNull(item))
4851
.forEach((headerLabel, index) => {
4952
expect(cells[index]).toHaveTextContent(RegExp(headerLabel));

0 commit comments

Comments
 (0)