Skip to content

Commit

Permalink
fix: table test fail
Browse files Browse the repository at this point in the history
  • Loading branch information
chunsch committed Dec 15, 2022
1 parent 1afc95b commit 79eb0a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 7 additions & 5 deletions components/table/__tests__/Table.expand.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ describe('Table.expand', () => {
/>,
);

// header has td element (a11y): https://github.com/react-component/table/pull/859
const tdNodeList = container.querySelectorAll('td');
expect(tdNodeList[0].textContent).toEqual('bamboo');
expect(tdNodeList[1].querySelector('.ant-table-row-expand-icon')).toBeTruthy();

expect(tdNodeList[2].textContent).toEqual('bamboo');
expect(tdNodeList[3].querySelector('.ant-table-row-expand-icon')).toBeTruthy();
});

it('work with selection', () => {
Expand All @@ -122,9 +124,9 @@ describe('Table.expand', () => {
/>,
);
const tdNodeList = container.querySelectorAll('td');
expect(tdNodeList[0].querySelector('.ant-checkbox-input')).toBeTruthy();
expect(tdNodeList[1].textContent).toEqual('bamboo');
expect(tdNodeList[2].querySelector('.ant-table-row-expand-icon')).toBeTruthy();
expect(tdNodeList[2].querySelector('.ant-checkbox-input')).toBeTruthy();
expect(tdNodeList[3].textContent).toEqual('bamboo');
expect(tdNodeList[4].querySelector('.ant-table-row-expand-icon')).toBeTruthy();
});
});
});
5 changes: 4 additions & 1 deletion components/table/style/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ const genTableStyle: GenerateStyle<TableToken, CSSObject> = (token) => {

// ============================ Header ============================
[`${componentCls}-thead`]: {
'> tr > th': {
[`
> tr > th,
> tr > td
`]: {
position: 'relative',
color: tableHeaderTextColor,
fontWeight: fontWeightStrong,
Expand Down

0 comments on commit 79eb0a9

Please sign in to comment.